Commit Graph

52 Commits

Author SHA1 Message Date
Ivan Max a46e3e9357
build-package.sh: adding compilation based on glibc (#16901)
[skip ci]
2023-08-30 23:40:08 +03:00
Tee KOBAYASHI 36cc364a89 termux_step_massage: Add `update-mime-database` guard
* Remove the guard in individual packages

%ci:no-build
2023-05-01 00:48:01 +09:00
Tee KOBAYASHI b6c843b06c termux_step_massage: Exclude some cache files 2023-04-30 23:10:48 +09:00
Aditya Alok 33b1397f36
haskell-packaging: End support for library packages
- Now we use cabal (comparable to rust's cargo) to build binary packages.

Reason:
- Haskell's cabal packaging system is like rust's cargo. Every packages
  depends upon some specific version of other library. Hence, it is
  hard to maintain each and every version.
- Patching packages so that they use latest of dependencies breaks
  compatibility.

Benefits:
- Enables building very large packages like `pandoc`.
- Reduces disk space used.
- Lesser packages to maintain.

Signed-off-by: Aditya Alok <alok@termux.dev>
2023-02-21 10:08:12 +05:30
Tee KOBAYASHI 9bd8fa840c scripts: Add new variable `TERMUX_PKG_NO_STRIP`
to disable stripping binaries.

To be used by `guile` package.
2023-01-31 03:44:27 +00:00
Tee KOBAYASHI acec7e6460 termux_step_massage: Insert `head -n 1` in shebang fix
to avoid "binary file matches" message.
2023-01-19 09:53:05 +00:00
Tee KOBAYASHI e9b1e0b2da termux_step_massage: Use `if` clause in shebang fix
to avoid error exit.
2023-01-19 09:53:05 +00:00
Tee KOBAYASHI 13a0d8229e termux_step_massage: Check for unresolved `posix_spawn`
and `posix_spawnp` defined in libandroid-spawn.

There are other symbols defined in libandroid-spawn, but hopefully this
is sufficient for the purpose of guarding underlinking.

Reference: https://github.com/termux/termux-packages/issues/14623
2023-01-18 13:12:50 +09:00
Tee KOBAYASHI 78715de5be termux_step_massage: Fix logic for undefined symbols
The pattern `for lib in "$(find [...])"` does not work if `find` matches
more than one file. Double quotes around `$(...)` must be removed.

This bug was introduced in 849112f9e7, and
the check did not work correctly from then on, until now.
2023-01-14 17:01:59 +09:00
Tee KOBAYASHI f68fba50b7 termux_step_massage: Check for `$PREFIX/man`
which indicates packaging error.
2023-01-10 10:05:05 +09:00
Tee KOBAYASHI cb8bc5eccf termux_step_massage: Check for Debianish Python dir
`$PREFIX/lib/python3/dist-packages` which indicates packaging error.
2023-01-08 16:46:29 +09:00
Tee KOBAYASHI 72db1a09ff termux_step_massage: Check for `$PREFIX/$PREFIX`
which almost always indicates packaging error.
2023-01-07 06:44:41 +09:00
Tee KOBAYASHI fbaecc5c26 termux_step_massage: Check for unresolved symbols
defined in libandroid-execinfo as well.

Reference: https://github.com/termux/termux-packages/issues/14285
2023-01-04 06:46:27 +09:00
Henrik Grimler 5d08ee2424
scripts: fix typo pacakge -> package 2023-01-03 19:53:23 +01:00
Henrik Grimler 4199c2a1fe
scripts: fix grep warnings from termux_step_massage
After upgrading grep from 3.7 to 3.8 it now warns when pattern
contains unnecessary escaped characters, like:

grep: warning: stray \ before !
grep: warning: stray \ before /
grep: warning: stray \ before /
grep: warning: stray \ before !
grep: warning: stray \ before /
grep: warning: stray \ before !
grep: warning: stray \ before /
grep: warning: stray \ before /
grep: warning: stray \ before !
grep: warning: stray \ before /

Silence these warnings by fixing our termux_step_massage function.
2022-10-01 12:15:02 +02:00
Henrik Grimler 5070174c4d
scripts(massage): fix undefined symbols grep pattern
This caused undefined symbols to go undetected in libzmq in latest
build.  Probably more packages are affected, should do a rebuild of
all packages again to check for undefined symbols.
2022-08-14 09:17:07 +02:00
Henrik Grimler 9641ff5fba
scripts(massage): use $READELF instead of hardcoding llvm-readelf 2022-08-02 11:48:51 +02:00
Henrik Grimler 792ccc6ca3
fix(scripts,step_massage): continue in for loop, not return
Missed this when changing back and forth from having the code in a
subfunction instead.

This caused termux_step_massage to return prematurely, and subpackages
to not be generated (which is how I noticed it).

Fixes commit 849112f9e7 ("scripts(massage): remove symbol loop in
undefined syms check").
2022-08-01 10:59:43 +02:00
Henrik Grimler 849112f9e7
scripts(massage): remove symbol loop in undefined syms check
Instead create a (rather large) grep pattern, and call egrep only
once.
2022-07-31 20:12:54 +02:00
Henrik Grimler 5ab6d52854
scripts(massage): specify target api level when running elf-cleaner
Termux-elf-cleaner 2.0.0 added the possibility to specify target api
level with --api-level, instead of just during compile time.
2022-07-30 16:44:07 +02:00
Lucinda May Phipps 7e2daf81e1 termux-step-massage: faster empty package check 2022-07-28 15:27:20 +05:00
agnostic-apollo f598de4ae4 fix(termux_step_massage): Fix typo in 034f29eb 2022-07-28 15:27:20 +05:00
Henrik Grimler 034f29eb0e scripts(massage): only suggest autoreconf if configure.{ac,in} exist 2022-07-22 16:38:44 +02:00
Butta a0f84bfd9a fix(termux_step_massage): use llvm-readelf instead, as that's what the NDK and Termux use 2022-06-25 22:55:36 +05:30
Tee KOBAYASHI d6248b4eb6 termux_step_massage: Check for unresolved symbols
defined in `libandroid-*`
2022-04-10 14:53:07 +09:00
Tee KOBAYASHI ae7f540379
termux_step_massage: Avoid using `CC`
which may be unset.
2022-04-06 14:14:03 +02:00
Henrik Grimler dc033aefef
termux_step_massage: only check for missing symbols if there are libraries 2022-04-05 21:21:29 +02:00
Henrik Grimler ffa1ed6051
termux_step_massage: check built libs for undefined symbols
Building packages that use libtool for linking libraries has issues
with ndk-r23 (https://github.com/android/ndk/issues/1614).  This check
makes sure that the built libraries do not give an error like

    CANNOT LINK EXECUTABLE "tesseract": cannot locate symbol "__extenddftf2" referenced by "/data/data/com.termux/files/usr/lib/libtesseract.so"...

once used on device.  In https://github.com/android/ndk/issues/1614 it
seemed like arm gave false positives and needed special consideration,
but when I tested it again today the same false positives do not occur
in built libraries, so no "if arm then .." workaround has been added
for now.
2022-04-05 20:57:25 +02:00
Aditya Alok 64535d4ac3
fix(haskell packages): do not delete `lib/ghc-*` directory for ghc and ghc-libs package itself
Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
2022-03-22 21:39:04 +01:00
Aditya Alok d47825a88c
feat(haskell build system): remove unwanted files/dirs before packaging
Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>

fix(termux_step_massage): add `-r` option to `rm` command to delete dir

Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>

wip
2022-03-16 15:32:01 +01:00
Leonid Pliushch 6572b28692
build-package.sh: introduce TERMUX_PKG_NO_SHEBANG_FIX
This variable will disable shebang fixing during massage step. Normally
such fix shouldn't be disabled, but there are packages where it causes
a huge overhead and is not needed anyway.

Packages that are known to be affected by overhead and take long time
for building:

 * papirus-icon-theme from x11-packages
2021-10-25 12:52:36 +03:00
Leonid Pliushch 07852c874b
build-package.sh: allow to select package formats between debian and pacman 2021-09-10 19:55:28 +03:00
Henrik Grimler 2c70621a98 build-package: rename TERMUX_DEBUG to TERMUX_DEBUG_BUILD
To make it more self-explanatory.
2021-08-21 20:55:57 +02:00
Leonid Pliushch 51866303ed
build-package.sh: run termux-elf-cleaner for ./opt 2021-07-29 22:38:21 +03:00
Henrik Grimler b3b5a3f35f mv checks from termux_step_create_datatar to termux_step_massage
By moving the checks we can make the function more general, and
thereby re-use it for creating subpackages and potentially hostbuild
tools packages.

tests: building libandroid-support and build-essential.
2021-05-16 20:08:37 +02:00
Leonid Pliushch 141703e676
build-package.sh: force remove ./share/icons/hicolor/icon-theme.cache from deb files
Specific to x11 packages. It is better to implement this in build-package.sh
instead of removing it on per-build.sh basis.
2021-03-02 00:17:36 +02:00
Leonid Pliushch c80220e31d build-package.sh: make it possible to disable termux-elf-cleaner
Just set TERMUX_PKG_NO_ELF_CLEANER=true in build.sh.
2020-10-01 19:34:19 +03:00
Leonid Pliushch 44403ceab3 build-package.sh: remove the info directory file from packages
Causes file conflicts like https://github.com/termux/termux-packages/issues/5487 and
generally shouldn't be needed for proper `info` functionality.
2020-07-07 19:22:00 +03:00
Leonid Pliushch 9db15acfce build-package.sh: delete .crates2.json in make_install step 2020-03-15 23:42:21 +02:00
Leonid Pliushch c7a91883cd build-package.sh: remove files .crates2.json from packages
.crates2.json is generated by cargo during the crate installation.

See https://github.com/termux/termux-packages/issues/5037.
2020-03-15 23:38:44 +02:00
Leonid Pliushch 5493481c5c build-package.sh: better support for metapackages 2019-08-14 20:29:58 +03:00
Leonid Pliushch d08dc0fa13 build-package.sh: use text-based comparsion in conditionals instead of exit-code based 2019-08-13 02:03:47 +03:00
Leonid Pliushch c352216c63 packages: standardize values of several control variables for build.sh
Variables

 TERMUX_PKG_PLATFORM_INDEPENDENT
 TERMUX_DEBUG
 TERMUX_PKG_HAS_DEBUG
 TERMUX_PKG_ESSENTIAL
 TERMUX_SUBPKG_ESSENTIAL
 TERMUX_PKG_NO_STATICSPLIT
 TERMUX_PKG_BUILD_IN_SRC
 TERMUX_PKG_FORCE_CMAKE
 TERMUX_PKG_HOSTBUILD

should not accept arbitrary values for marking them "enabled". Instead
they should accept boolean values which makes them easier to handle and
also makes their meaning clear.

build-package.sh should make decision based on variable's value but not on
whether it is set or empty.

%ci:no-build
2019-08-12 18:49:13 +03:00
Leonid Pliushch 0b4d758d6d fix typo in termux_step_massage.sh 2019-08-11 03:27:18 +03:00
Leonid Pliushch 4583afe579 build-package.sh: fix error in termux_step_massage() when bin, lib, libexec are not exist
Fixes https://github.com/termux/termux-packages/issues/4160.
2019-08-11 03:24:28 +03:00
Leonid Pliushch e303212ae5 enable on-device builds
Partial compatibility for on-device builds.

There is no guarantee that it will be possible to build all available
packages and built packages will have same reliability that cross-compiled
but should solve "self-hosting" problems as much as possible.
2019-08-08 16:58:34 +03:00
Leonid Pliushch 6e70277fb3 no more develsplit + provide static libraries as separate package
%ci:no-build
2019-07-28 21:17:12 +03:00
Leonid Pliushch 2fa11b13ef build-package.sh: always keep info pages
Info pages usually provide more complete information
about package and its usage than man pages.
2019-07-02 00:00:02 +02:00
Henrik Grimler 1197b9a9e0 termux_step_massage: drop TERMUX_PKG_KEEP_SHARE_DOC 2019-05-19 21:36:30 +03:00
Leonid Pliushch 8f042ae6b3 build-package.sh: do not try to gzip manpages that are already gzipped
Avoid warning and broken symlinks.
2019-04-09 17:45:43 +03:00