Commit Graph

75 Commits

Author SHA1 Message Date
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
Jakub Jirutka
1647fef93a newapkbuild: add empty line after builddir= and quote whole value 2016-06-13 22:43:27 +02:00
Jakub Jirutka
a3ce23dd53 newapkbuild: omit depends_dev if no *.h or *.hpp file found 2016-06-13 12:37:20 +00:00
Jakub Jirutka
630c244cfe newapkbuild: fix undefined variable $_builddir 2016-06-13 12:37:20 +00:00
Natanael Copa
270e5337e7 newapkbuild: rename _builddir to builddir
the _builddir should never been used bu abuild due to the _ prefix.
2016-03-23 10:08:00 +00:00
Michael Zuo
d1ab7ed40f newapkbuild: remove default prepare()
Do not add prepare() to new APKBUILDs in the future, as this
functionality is superseded by the addition of the default prepare
patcher in abuild.
2016-02-22 14:05:25 +02:00
Natanael Copa
d9eba16d35 newapkbuild: dont set CXX/C COMPILER
cmake is normally able to figure it out and setting them may break
ccache.
2015-11-30 07:26:56 +00:00
Natanael Copa
8638dacee0 newapkbuild: do not add --infodir
normally not used
2015-11-30 07:26:56 +00:00
Bartłomiej Piotrowski
e1d64f4b0e newapkbuild: *.la files are removed by default 2015-09-15 20:58:46 +02:00
Isaac Dunham
582b477817 newapkbuild: add CMake support.
This is a first try that *might* work for cross-compiling packages with
an absolute bare minimum of requirements, if you're lucky.
I can't debug that part further, but the references should help with it.
2015-05-27 07:03:35 +00:00
Natanael Copa
ad9db219b8 fix permissions 2014-03-31 11:49:48 +00:00
Natanael Copa
60dda6785f newapkbuild: detect github archives 2013-11-21 09:21:50 +00:00
Natanael Copa
beb15ad8ba newapkbuild: cosmetic fix for help message 2013-10-25 08:14:10 +00:00