Commit graph

10221 commits

Author SHA1 Message Date
tnn
17620cc568 ocaml.mk: try to fix PKGMANDIR support 2022-04-12 11:27:13 +00:00
riastradh
a649e3b771 mk: Use CWRAPPERS_PREPEND for --sysroot.
Looks like maybe the -Wl,-rpath-link business isn't necessary after
all -- will leave this as is until I find evidence otherwise.  (joerg
says it was a workaround for NetBSD toolchain parts that weren't
properly adapted to use sysroot.)

With this, revert cwrappers version dependency to what it was before.
But keep it as TOOL_DEPENDS, not BUILD_DEPENDS.
2022-04-10 19:54:02 +00:00
rillig
a52c6a65a5 mk: add show-depends-all
Previously, there was no easy way to list all dependencies of a package.
The target show-depends only lists the direct missing dependencies, the
target show-depends-dirs lists all direct dependencies, but neither
lists the indirect dependencies as well.  The newly added target
show-depends-all includes the indirect dependencies.

While here, document the existing targets since they differ subtly.

https://mail-index.netbsd.org/pkgsrc-users/2022/04/07/msg035444.html
2022-04-09 00:46:12 +00:00
adam
d5218f014a Make pkglint happy 2022-04-07 12:12:02 +00:00
nia
ca60b0b578 gcc.mk: gcc8 and gcc9 from pkgsrc do not build on 32-bit netbsd arm
workaround PR pkg/56679
2022-04-07 07:08:34 +00:00
wiz
5af065b4ff mk: document xps option 2022-04-06 06:12:09 +00:00
jperkin
0b3d39a899 mk: Fix malformed conditional.
There's no guarantee that POSSIBLE_GFORTRAN_VERSION is a numeric value,
so cannot be compared as such.  For example on my macOS it is set to
"clang-12 (clang-1205.0.22.9)".

This really needs to be normalised correctly at some point.
2022-04-04 15:38:47 +00:00
riastradh
d237f71fea mk/pkgformat/pkg: Fix deinstall of cross-built package. 2022-04-04 11:40:20 +00:00
riastradh
d8bc697ded mk: For cross-builds, use work.$ARCH and packages.$ARCH by default.
Otherwise it is mandatory to set these in mk.conf anyway, so let's
save the trouble.
2022-04-04 11:23:18 +00:00
riastradh
a1abd9761c mk: Cross-eyed hacks to support cross-libtool.
For a long time, when cross-building, say from native=amd64 to
target=powerpc, it was necessary to:

1. cross-build a _powerpc_ package called cross-libtool-base-powerpc,
   and then

2. install the powerpc package _natively_ with `pkg_add -m x86_64' to
   override the architecture check that normally forbids this kind of
   shenanigans,

in order to cross-build anything that uses libtool as a tool.

This is partly because libtool doesn't follow the normal GNU
convention of `./configure --build=<native platform> --host=<platform
package will run on> --target=<platform package is configured to
operate on>' -- in this example, build=amd64, host=amd64,
target=powerpc.

Instead, libtool expects to be cross-built itself, even if it's going
to run as a tool.  It's not as bonkers as it sounds at first: libtool
is just a shell script, and it caches various information about the
(cross-building!) toolchain it is built with so it can use that
information later when it is run as a tool itself to cross-compile
other software.

To make this work, we need to create the toolchain wrappers for
libtool _as if_ we were cross-building even if we are building a
native package.  So mk/tools uses a new flag TOOLS_USE_CROSS_COMPILE
instead of USE_CROSS_COMPILE, and libtool internally sets
MACHINE_ARCH=${TARGET_ARCH} (in the example above, powerpc) to make
it look like we're cross-building.  The new TOOLS_CROSS_DESTDIR is an
alias for the (defaulted) CROSS_DESTDIR, which must now be set
unconditionally in mk.conf in order for libtool to know where the
cross-destdir will be; _CROSS_DESTDIR remains empty when building any
native packages (including the native cross-libtool package).

Finally, we need to make the resulting package be a native package,
with MACHINE_ARCH set to the one that it will be installed on (in the
example above, amd64), so I added an indirection _BUILD_DEFS.${var}
to replace var on its own in the build definitions that get baked
into the package, shown by `pkg_info -B'.  Setting
_BUILD_DEFS.MACHINE_ARCH=${NATIVE_MACHINE_ARCH} ensures that this
mutant hybrid cross-built libtool still produces a native package.

All of this logic is gated on setting USE_CROSS_COMPILE in mk.conf or
LIBTOOL_CROSS_COMPILE in the package makefile, so it should be safe
for non-cross-builds -- when USE_CROSS_COMPILE=no and you're not
building cross-libtool, everything is as before.
2022-04-04 11:23:06 +00:00
riastradh
81729c2501 cwrappers: Add cross-compilation support.
- New option `sysroot=<dir>':
  . Wrapper will add `--sysroot=<dir>' as first argument.
  . For every rpath argument, e.g. -Wl,-R<path> to cc, wrapper will
    pass `-rpath-link <dir><path>' to the linker.
  This matches the old mk/wrapper/cmd-sink-cross-* logic.

- Create wrappers for the ${MACHINE_GNU_PLATFORM}-cc style of command,
  as in ${CC}, ${CXX}, ${LD} for cross-builds.

- Bump version.

- Use TOOL_DEPENDS, not BUILD_DEPENDS, for cwrappers.
2022-04-04 11:22:50 +00:00
riastradh
de4c5ea882 mk/tools: Fix readelf for cross-compilation on NetBSD.
This is needed by check-pie.
2022-04-03 10:33:44 +00:00
nia
d98deba6c1 gfortran: Correct notion of check. All pkgsrc gccs before version 10 are
broken on 32-bit arm.
2022-04-02 08:01:48 +00:00
nia
c7c1c82592 gfortran.mk: Use gcc version 10 on all arm-type netbsds. 2022-04-02 07:57:11 +00:00
nia
f3f2f94f6c mk/defaults: document SDL12_TYPE 2022-04-01 10:46:44 +00:00
nia
a059fcaba3 mk/defaults: document RUST_TYPE 2022-04-01 07:32:11 +00:00
tnn
c66e9db28b mk: revert local change 2022-03-28 10:49:12 +00:00
tnn
536ce33d1f m*/*: revbump(1) for libsndfile 2022-03-28 10:45:17 +00:00
rillig
afcf35629e mk/java-vm.mk: clean up documentation 2022-03-19 14:10:51 +00:00
nia
711c75b795 mk: MKPIE is not GCC-specific. Should help ObjC packages. 2022-03-13 06:26:57 +00:00
nia
ac88c22960 mk/check: Do not waste time checking binaries that set EMUL_PLATFORM. 2022-03-07 16:53:08 +00:00
nia
666362de88 mk/platform: Add a variable for detectic static PIE support. 2022-03-03 07:30:06 +00:00
mrg
3328e3635b match/pass mipsn64e[lb]. 2022-03-03 03:33:22 +00:00
mrg
1b4558fc9e default OCAML_USE_OPT_COMPILER to YES on arm64eb. 2022-03-03 03:32:28 +00:00
pho
555de7c535 mk/haskell.mk: Enable --enable-split-sections
Ask GHC to put each compiled function in a separate section and ld(1) to
perform GC. This greatly reduces the size of executables linked with static
Haskell libraries. For example, lang/purescript shrinks down from 104 MiB
to 57 MiB! Reduced storage use means reduced I/O cost!
2022-02-26 03:55:37 +00:00
pho
aad7fd9413 mk/haskell.mk: Add a package-settable variable HASKELL_ENABLE_DYNAMIC_EXECUTABLE
Prior to this change, packages that install both libraries and executables
were both linked dynamically when HASKELL_ENABLE_SHARED_LIBRARY is set to
yes. This turned out to be problematic when the executables end up
depending on hundreds of shared objects (which occurs rather frequently for
tools written in Haskell): the dynamic linker spends several seconds upon
loading the executables to resolve all the symbols.

Now we can selectively opt out from dynamic linkage by setting
HASKELL_ENABLE_DYNAMIC_EXECUTABLE to no. This should be done carefully,
because linking executables with static Haskell libraries means that those
executables will also use static RTS. This causes problems if they use GHC
API to interpret Haskell code at run time: static RTS would violate PaX
MPROTECT and suffer from ASLR while loading static objects.
2022-02-23 16:03:00 +00:00
wiz
4484a87bee mk/scripts/remove_todo: support python 3.10 2022-02-18 18:10:09 +00:00
wiz
6bda17fb11 mk/ocaml.mk: add some automation for prefixing ${PLIST.ocaml-opt} 2022-02-14 11:37:48 +00:00
wiz
917caf6b4b mk/ocaml.mk: remove jbuilder support 2022-02-14 11:24:57 +00:00
pho
a59a2656f9 Fix a broken CVS tag 2022-02-14 00:31:18 +00:00
nia
6400a3e964 mk: Flip partial MKRELRO back on now that many problems have been resolved. 2022-02-13 11:06:42 +00:00
nia
b00de445c0 check-pie-elf.awk: make the failure case amuse me less 2022-02-13 10:48:24 +00:00
pho
822826a3f8 mk/haskell.mk: Switch the default Haskell compiler to lang/ghc92 2022-02-12 08:38:15 +00:00
pho
b47b80d798 Wrote a packaging guide for Haskell packages 2022-02-11 05:24:06 +00:00
pho
6bb80a54ac Infrastructure improvements and bugfixes to mk/haskell.mk
* mk/haskell.mk no longer set USE_TOOLS+=pkg-config for all the packages
  that include it. Instead it does TOOLS_FAIL+=pkg-config unless they
  explicitly do USE_TOOLS.

* Fixed an issue regarding Template Haskell and our wrappers.

* Fixed an issue where packages that had things like PLIST.common but
  lacked PLIST were incorrectly considered to have no PLISTs.

* mk/haskell.mk now supports packages that contain more than a single
  library. The INSTALL and DEINSTALL scripts can now handle such packages
  properly.
2022-02-11 01:11:57 +00:00
schmonz
0e29b0a970 Fix GLIBC_VERSION detection on Manjaro ARM (so that devel/gettext-tools
passes PLIST checks) and probably other Arch Linux too.
2022-02-10 21:22:44 +00:00
gutteridge
524b41c341 buildlink3/find*.mk: fix typos in comments 2022-02-10 18:58:37 +00:00
pho
e6b403f35b Warn when PLIST is missing, not just when it is outdated 2022-02-07 02:58:24 +00:00
pho
829724adf5 Fix a bug in my previous commit 2022-02-07 02:43:42 +00:00
pho
1a798fd2dd Handle the case where *.cabal lacks the field "Build-Type" 2022-02-07 02:39:41 +00:00
gutteridge
226926d973 options.description: add a couple of PHP options 2022-02-07 02:14:35 +00:00
schmonz
aa0ba74e0b Add OSX_SDK_MAP for 12.2. From Herbert J. Skuhra in private mail. 2022-02-05 21:43:17 +00:00
wiz
9265e3fae1 compiler/clang.mk: do not disable PIE support
joerg says clang has the same interface for this like gcc
2022-01-30 13:07:34 +00:00
schmonz
c070be973a Add defaults for DQCACHE_{USER,GROUP}. 2022-01-27 15:32:34 +00:00
pho
c7ea0c443f Fix FUSE version in fake pkg-config files
The original FUSE contains a patch version in fuse.pc or fuse3.pc. We must do
the same or otherwise pkg-config requirements such as 'fuse >= 2.6.0' will fail.
2022-01-27 04:27:05 +00:00
gutteridge
9194a16051 help/help.mk: pick up further language-specific variables
Add lua, nodejs, octave, qore, and tk-specific variables. (tk and tk85
define the same variable, so I only included tk.) This relates to
PR pkg/56301, where I noticed various REPLACE_* variables were not
listed in Appendix E of the pkgsrc guide.

There is a separate issue related to Appendix E here. If wip/mk is
found, the auto-generation of the help topic list for the pkgsrc guide
includes anything it finds under that path, but that's potentially
misleading, and causes the generated list to see-saw back and forth as
committers do or do not have wip visible (I do not).
2022-01-24 23:16:01 +00:00
gutteridge
65783bd529 defaults/mk.conf: remove some now unused variables
Prune a bunch of variables that haven't been used for years. In some
cases, the packages they influenced don't even exist anymore. There may
be more of these, this is after a quick pass through.
2022-01-24 23:11:32 +00:00
pho
aef4f625df Create both pkgconfig/fuse.pc and pkgconfig/fuse3.pc
Some packages expect fuse3.pc for FUSE >= 3. Also do not hard-code the version
of <fuse.h> as it becomes quickly obsolete.
2022-01-22 18:23:43 +00:00
pho
af87f2f6ac Emit a warning when PKGSRC_MKPIE==yes but PKGSRC_COMPILER==clang
Prior to this change PKGSRC_MKPIE was silently ignored when clang was chosen for
the compiler, i.e. executables were never built as PIE. This became an error
after introducing a post-build check for it.

Of course we should add a MKPIE support for clang, but for now we just emit a
warning. Otherwise we cannot build packages such as devel/gnustep-base which
requires clang to build.
2022-01-19 16:06:43 +00:00
pho
db46eea828 Support PKGSRC_MKPIE 2022-01-18 02:24:36 +00:00