-
Notifications
You must be signed in to change notification settings - Fork 21
Add meson.build script #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nvinson
wants to merge
1
commit into
zlin:master
Choose a base branch
from
nvinson:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,26 @@ | ||
| name: 'wgetpaste test runner' | ||
| on: [pull_request, push] | ||
| jobs: | ||
| run-test: | ||
| name: 'Run test/test.sh' | ||
| run-tests: | ||
| strategy: | ||
| matrix: | ||
| test: [test, test_ansi] | ||
| name: "Run test/${{ matrix.test }}" | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - run: test/test.sh | ||
| shell: bash | ||
| run-test-ansi: | ||
| name: 'Run test/test_ansi.sh' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: 'Install ansifilter' | ||
| - name: 'Checkout repository' | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: 'Install dependencies' | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install ansifilter | ||
| - run: test/test_ansi.sh | ||
| sudo apt-get install meson ${{ matrix.test == 'test_ansi' && 'ansifilter' || '' }} | ||
| shell: bash | ||
|
|
||
| - name: 'Build wgetpaste' | ||
| run: | | ||
| mkdir build | ||
| meson setup build --prefix="/" | ||
| shell: bash | ||
|
|
||
| - run: meson test -C ./build ${{ matrix.test }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| project( | ||
| 'wgetpaste', | ||
| license: 'MIT', | ||
| license_files: 'LICENSE', | ||
| version: '2.35.0', | ||
| meson_version: '>=1.1.0', | ||
| ) | ||
|
|
||
| config_data = configuration_data() | ||
| config_data.set('WGETPASTE_SHEBANG', get_option('shebang')) | ||
| config_data.set('WGETPASTE_VERSION', meson.project_version()) | ||
| configure_file( | ||
| output: 'wgetpaste', | ||
| input: 'wgetpaste', | ||
| configuration: config_data, | ||
| install: true, | ||
| install_dir: get_option('bindir'), | ||
| install_mode: 'rwxr-xr-x' | ||
| ) | ||
|
|
||
| install_data( | ||
| '_wgetpaste', | ||
| install_dir: get_option('datadir') / get_option('zsh-completions-dir'), | ||
| install_mode: 'rw-r--r--' | ||
| ) | ||
|
|
||
| test_runner = find_program('test/test.sh') | ||
| test( | ||
| 'test', | ||
| test_runner, | ||
| timeout: 0, | ||
| env: [ | ||
| 'MESON_BUILD_ROOT=' + meson.project_build_root() | ||
| ] | ||
| ) | ||
|
|
||
| test_runner = find_program('test/test_ansi.sh') | ||
| test( | ||
| 'test_ansi', | ||
| test_runner, | ||
| timeout: 0, | ||
| env: [ | ||
| 'MESON_BUILD_ROOT=' + meson.project_build_root() | ||
| ] | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| option( | ||
| 'shebang', | ||
| type: 'string', | ||
| value: '/usr/bin/env bash', | ||
| description: 'Specify shebang line for wgetpaste script' | ||
| ) | ||
| option('zsh-completions-dir', | ||
| type: 'string', | ||
| value: 'zsh/site-functions', | ||
| description: 'Specify location of zsh-completions directory (relative to datadir)' | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,9 @@ | ||
| #!/usr/bin/env bash | ||
| #!@WGETPASTE_SHEBANG@ | ||
| # A Script that automates pasting to a number of pastebin services | ||
| # relying only on bash, sed, coreutils (mktemp/sort/tr/wc/whoami/tee) and wget | ||
| # Copyright (c) 2007-2016 Bo Ørsted Andresen <[email protected]> | ||
|
|
||
| VERSION="2.33" | ||
| VERSION="@WGETPASTE_VERSION@" | ||
|
|
||
| # don't inherit LANGUAGE from the env | ||
| unset LANGUAGE | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm probably just ignorant, but do we really have to make the shebang configurable? Isn't
/usr/bin/envsupposed to be universal?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The configuration is optional. If the builder does not set
WGETPASTE_SHEBANGit defaults to/usr/bin/env bash./usr/bin/envdoes depend on the environment variable PATH being correctly set to find bash. Generally this isn't a problem, but on the few occasions it is, this option allows a downstream builder to hard code the correct path for bash.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a bash script happens to use features of Bash 4.x then using
/usr/bin/env bashis unreliable and will break on systems such as macOS where you must guarantee that the "correct, new enough* version of bash is utilized regardless of how the user configures$PATH.