Commit Graph

87 Commits

Author SHA1 Message Date
Luca Weiss
f92b56d8c9 newapkbuild: generate check for meson
The function already exists but it was never called.
2021-04-12 15:02:18 +00:00
Luca Weiss
05d36a90ce newapkbuild: escape meson variables
Otherwise we'll generate e.g. 'meson compile -j 7 -C output'
2021-04-12 15:02:18 +00:00
Bart Ribbers
700bdb552f newapkbuild: don't try to build in the package target when using cmake, just install 2021-01-07 14:05:47 +00:00
Jakub Jirutka
b78073f663 newapkbuild: remove /usr/.cargo* after cargo install
cargo is now generating two files: .cargo.toml and .cargo2.json.
2020-12-14 07:23:20 +00:00
Newbyte
55be1feb02 newapkbuild.1: remove redundant parenthesis in CMake generator so apkbuild-lint stops complaining 2020-11-08 14:31:46 +00:00
Leo
8eeca0adad *: say we are using GPL-2.0-only 2020-10-23 11:39:18 -03:00
Rasmus Thomsen
2cc63809ad newapkbuild: invoke meson directly for build/test/install instead of ninja
This has multiple advantages:
* It's tool agnostic (e.g. if we were to drop the ninja symlink
  for samu, we wouldn't have to change anything here)
* It allows for more fine grained control, e.g. in meson test,
  where we can increase timeouts and print the test log to stdout,
  something which we can't control when invoking it via ninja.
* We can pass --no-rebuild to test and install, so ninja doesn't
  have to check if anything has to be rebuild against in the test
  and install phase, when we built everything in the build phase
  already

This is similiar to dd24cdf85f, but
for meson.
2020-07-06 18:34:29 +00:00
Rasmus Thomsen
d3c93a3d15 abuild: set --locked for all cargo invocations
That ensures that we always use the versions specified in the Cargo.lock
file, which is required for reproducible builds
2020-07-06 10:00:13 +00:00
Bart Ribbers
dd24cdf85f newapkbuild: make CMake packages use cmake --build directly rather than through make 2020-07-06 09:47:29 +00:00
Natanael Copa
7779e913e7 newapkbuild: allow -n option without url 2020-04-14 13:53:10 +00:00
Leo
d0ce42112f newapkbuild: treat packages that start with py[0-9]- as python packages. 2020-03-30 10:59:06 +00:00
Sören Tempel
5cc73d98c3 newapkbuild: do not pass CFLAGS and CXXFLAGS explicitly
With the None build type used nowadays these should be picked up
automatically by the environment. If not, we would also need to pass
CPPFLAGS and LDFLAGS explicitly.
2020-03-30 10:58:02 +00:00
TBK
1888007c38 newapkbuild.in: Allign with CODINGSTYLE quoting 2020-03-23 13:58:59 +00:00
Rasmus Thomsen
69fc8b8fc1 newapkbuild: use 'plain' buildtype for meson and 'None' buildtype for CMake
This way Meson and CMake will use the C{,PP,XX}FLAGS we've set in
`/etc/abuild.conf`. Without this change CMake and meson will overwrite
our CFLAGS with custom flags. Most importantly, they prefer -O1/-O2 over
our -Os.

See also: https://lists.alpinelinux.org/~alpine/devel/%3C2896c13070c508a49cbaa72c8fb7f34ea947358b.camel%40cogitri.dev%3E
2020-02-21 18:01:48 +01:00
Leo
e125a76489 newapkbuild: do out-of-source CMake builds by default
It is recommended by upstream CMake (it will warn when you do in-source
builds) to keep generated files away from the source.
2020-02-16 19:05:42 +01:00
Natanael Copa
c486b3b4f3 allow override sharedir for testing
Aloow overrid sharedir with global ABUILD_SHAREDIR so we test the local
functions.sh instead of a system installed functions.sh
2019-11-07 11:42:23 +00:00
Natanael Copa
f3dc428ea0 rename datadir -> sharedir
abuild uses datadir as local variable in various functions. Rename the
global datadir to sharedir to avoid confusion.
2019-11-07 11:42:23 +00:00
Jakub Jirutka
a8f564287e newapkbuild: simplify source URL derived from GitHub URL
GitHub allows to reference https://github.com/<user>/<proj>/archive/<ver>.tar.gz
also as https://github.com/<user>/<proj>/archive/<ver>/<anything>.tar.gz.
2019-10-27 20:35:10 +01:00
Jakub Jirutka
6c3b2e6b58 newapkbuild: run cargo install with --locked
This forces cargo to install the exact versions of the dependencies
specified in Cargo.lock. This is essential for reproducible builds!
2019-10-27 13:50:53 +01:00
Rasmus Thomsen
05eee44039 newapkbuild: add rust support 2019-10-01 17:12:19 +01:00
Natanael Copa
b7fd57f681 newapkbuild: make python packages only depend on setuptools
They normally don't need the python3-dev.
2019-07-17 12:00:57 +00:00
Russ
bffe0efc06 newapkbuild: add py3-setuptools to python apkbuild
Seeing as the default python build/check/package apkbuild functions call `setup.py` and that relies on `py3-setuptools`, perhaps it should be added to the makedepends.

Inspiration from https://github.com/alpinelinux/aports/pull/7641#pullrequestreview-234326397
2019-07-17 12:00:11 +00:00
Russ
2122fa7476 newapkbuild: use current directory for cmake 2019-06-12 12:21:19 +00:00
tcely
49c7560c86 newapkbuild: quote pkgname and pkgver
These are strings after all and should be quoted even if not strictly necessary because of tradition excluding spaces from package names.
2019-06-12 12:20:35 +00:00
Leo
b743186dfe newapkbuild.in: add default check() for meson packages. 2019-06-12 12:19:58 +00:00
Oliver Smith
da4aca278f Cosmetic: newapkbuild: comment for check sections
Add a '# Check sections' comment, for consistency with the equally
commented build and package sections.
2019-06-12 12:18:59 +00:00
Oliver Smith
635a699365 newapkbuild: fix empty function regression
Since the obsolete 'cd "$builddir"' statements have been removed in [1],
build(), check() and package() can generate empty functions if no build
system is specified or if there is no default for the given build
system. newapkbuild will then fail, as it tries to parse the script it
generated:

$ cd /home/pmos && newapkbuild test
/usr/bin/abuild: /home/pmos/test/APKBUILD: line 18: syntax error: unexpected "}"
$ cat test/APKBUILD
...
build() {
}
...

Fix this by placing ":" in functions that would be empty.

[1]: f83d19ce79
2019-06-12 12:18:59 +00:00
Ikke
f83d19ce79 newapkbuild: remove obsolete cd statements
Since `$builddir` is officially supported and abuild automatically cd's to `$builddir`, it does not need to be part of the template anymore.
2019-04-29 18:34:03 +00:00
Natanael Copa
51830efbb5 newapkbuild: fix checksums to be last in ABPKUILD
ref https://github.com/alpinelinux/abuild/pull/42
2018-10-03 10:50:25 +00:00
prspkt
9aef4769d1 newapkbuild: use https for sourceforge download links 2018-09-24 21:43:49 +02:00
Jakub Jirutka
1820691b94 newapkbuild: fix default check function for python3
`setup.py check` does not run package tests, it performs just some check
of the package metadata. The correct command is `setup.py test`.
2018-07-29 16:21:29 +02:00
Oliver Smith
a68354ebc5 newapkbuild: check arguments and improve usage()
Changes:
* argument sanity checks:
  * `PKGNAME[-PKGVER] | SRCURL`
    * check if missing
    * check if specified more than once (see below)
  * specifying more than one buildtype flag
  * `-n` (set pkgname) without using SRCURL as last argument
  * `-s` (sourceforge source) without using PKGNAME as last argument
* Typo fix: exist -> exists
* `usage()`:
  * always print PKGNAME and PKGDESC (instead of NAME and DESC,
    NAME was used in one place and PKGNAME in another)
  * link to <https://spdx.org/licenses/>
  * `-m` (meson) flag was missing in short usage line at the top
  * indicate that the buildtypes are exclusive
  * `-c` flag: remove "to new directory" wording to make the
    message shorter (this should be obvious)
  * remove empty line at the end

NOTE: Before this commit, the `PKGNAME[-PKGVER] | SRCURL` was allowed
to be specified more than once, and the code looped over the arguments.
But this was not documented in `usage()` and had unexpected results:

```
$ newapkbuild first second third
$ tree
.
___ first
    ___ APKBUILD
    ___ first
    ___ ___ APKBUILD
    ___ ___ first
    ___ ___ ___ APKBUILD
    ___ ___ ___ src
    ___ ___ src
    ___ src
```
2018-06-21 15:30:58 +00:00
A. Wilcox
75b8cacaf0 newapkbuild: move checksum call to after fetch
unpack will no longer unpack without a checksum, even with -f.  This
means that newapkbuild will not be able to deduce what kind of build
system is contained within, so the templates for CMake, Perl, etc are
never used.

This patch ensures checksumming is done right after fetch, so that
unpack works properly.
2018-05-24 17:58:55 +02:00
A. Wilcox
db5ca2996a newapkbuild: fix typo 2018-05-24 17:58:55 +02:00
Jakub Jirutka
6c2fc64d74 newapkbuild: create check() function 2018-05-07 22:33:12 +02:00
Jakub Jirutka
1264917824 newapkbuild: change python to python3 2018-05-07 22:22:26 +02:00
Oliver Smith
d007f7967c newapkbuild: fix typo 2017-12-30 10:46:02 +01:00
Sören Tempel
800e4a8187 newapkbuild.in: fix package_meson by escaping $pkgdir 2017-10-28 10:35:16 +02:00
A. Wilcox
83f37d0076 newapkbuild: use make 'package' phase for CMake as well 2017-10-19 13:25:24 +02:00
Sören Tempel
17eb90499e newapkbuild: always set makedepends in newaport 2017-10-19 10:49:39 +02:00
Sören Tempel
22fe641721 newapkbuild: add command line flag for cmake to getopts
It is documented in the help output but didn't work because getopts(1)
didn't check for that option. I am assuming the person who added cmake
support simply forgot to adjust the getopts line.
2017-10-19 10:42:11 +02:00
Sören Tempel
f91242fe39 newapkbuild: add support for meson 2017-10-19 10:40:28 +02:00
A. Wilcox
0296de9cd1 newapkbuild: detect CMakeLists.txt file for CMake
Some CMake packages do not have cmake/ directory, but all have
CMakeLists.txt present in the root directory.
2017-09-28 10:01:10 +03:00
A. Wilcox
27005a2cb0 newapkbuild: fix usage output 2017-06-23 11:27:41 +03:00
Jakub Jirutka
5dfb7a3634 newapkbuild: fix build_cmake template - escape parameters 2017-05-19 21:19:00 +02:00
Sören Tempel
c95263d877 remove explicit || return 1 from all sample APKBUILDs
Those statement are no longer needed because abuild now runs with
`set -e` by default.

See also: 36d5193776
2017-04-05 10:30:44 +00:00
Jakub Jirutka
948fedc5f7 indent heredocs when possible 2016-08-23 00:09:06 +02:00
Jakub Jirutka
e8508f7b18 add .editorconfig and fix code formatting 2016-08-20 16:16:37 +02:00
Sören Tempel
4bfb5c8fc1 newapkbuild: redirect find(1) stderr to /dev/null
If $sdir is not defined find writes an error message to stderr. For
example when running:

	newapkbuild -n foo -a foo

You will see a find error message because no source url was provided.
This commit silences any find error message. An alternative solution
would be to not invoke find unless $sdir is set.
2016-06-20 11:15:42 +02:00
Jakub Jirutka
8919e1eee8 newapkbuild: remove trailing spaces 2016-06-13 22:49:27 +02:00