2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv
|
2020-03-31 02:34:20 +00:00
|
|
|
, fetchurl
|
2020-03-31 03:13:44 +00:00
|
|
|
, python3
|
2020-03-31 02:34:20 +00:00
|
|
|
, pkg-config
|
|
|
|
, readline
|
|
|
|
, tdb
|
|
|
|
, talloc
|
|
|
|
, tevent
|
|
|
|
, popt
|
|
|
|
, libxslt
|
|
|
|
, docbook-xsl-nons
|
|
|
|
, docbook_xml_dtd_42
|
|
|
|
, cmocka
|
2023-09-03 00:24:44 +00:00
|
|
|
, wafHook
|
wafHook: don't add cross compilation flags
These flags are not part of waf, they're custom flags that are not
widely implemented. More packages are broken because of these flags
being added than actually recognise them.
Of the packages in Nixpkgs that directly depend on wafHook that we can
attempt to cross compile (i.e. all their dependencies cross compile),
5 already successfully cross compile and recognise these flags, 2
already successfully cross compile because they have been opted out of
these flags, 3 don't cross compile successfully for reasons unrelated
to these flags, and for the remaining 7, the only thing stopping them
cross compiling successfully is that they are being passed these flags
that they don't recognise.
All of the five successfully cross-compiling packages that do
recognise these flags are samba projects: ldb, talloc, tdb, tevent,
and samba4. So this isn't a general waf convention, just a samba one.
It therefore doesn't make sense to set these flags by default. They
should just be included in the expressions for each samba project,
like all the other quirks common to samba build systems.
This change fixes cross compilation of the following packages:
blockhash ganv ndn-cxx mda_lv2 pflask raul saldl
2024-05-09 16:41:48 +00:00
|
|
|
, buildPackages
|
2023-02-11 15:52:13 +00:00
|
|
|
, libxcrypt
|
2024-04-06 11:25:17 +00:00
|
|
|
, testers
|
2014-04-30 07:42:02 +00:00
|
|
|
}:
|
|
|
|
|
2024-04-06 11:25:17 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-03-31 02:34:20 +00:00
|
|
|
pname = "ldb";
|
2024-06-20 04:32:20 +00:00
|
|
|
version = "2.9.1";
|
2014-04-30 07:42:02 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2024-07-13 00:17:48 +00:00
|
|
|
url = "mirror://samba/ldb/ldb-${finalAttrs.version}.tar.gz";
|
2024-06-20 04:32:20 +00:00
|
|
|
hash = "sha256-yV5Nwy3qiGS3mJnuNAyf3yi0hvRku8OLqZFRoItJP5s=";
|
2014-04-30 07:42:02 +00:00
|
|
|
};
|
|
|
|
|
2016-09-19 13:33:35 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2020-03-31 02:34:20 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
2020-03-31 03:13:44 +00:00
|
|
|
python3
|
2023-09-03 00:24:44 +00:00
|
|
|
wafHook
|
2020-03-31 03:13:44 +00:00
|
|
|
libxslt
|
|
|
|
docbook-xsl-nons
|
|
|
|
docbook_xml_dtd_42
|
2023-02-11 15:52:13 +00:00
|
|
|
tdb
|
|
|
|
tevent
|
2020-03-31 02:34:20 +00:00
|
|
|
];
|
|
|
|
|
2014-04-30 07:42:02 +00:00
|
|
|
buildInputs = [
|
2020-03-31 03:13:44 +00:00
|
|
|
python3
|
|
|
|
readline # required to build python
|
2020-03-31 02:34:20 +00:00
|
|
|
tdb
|
|
|
|
talloc
|
|
|
|
tevent
|
|
|
|
popt
|
2018-04-29 02:13:12 +00:00
|
|
|
cmocka
|
2023-02-11 15:52:13 +00:00
|
|
|
libxcrypt
|
2014-04-30 07:42:02 +00:00
|
|
|
];
|
|
|
|
|
2023-01-02 19:07:33 +00:00
|
|
|
# otherwise the configure script fails with
|
|
|
|
# PYTHONHASHSEED=1 missing! Don't use waf directly, use ./configure and make!
|
|
|
|
preConfigure = ''
|
|
|
|
export PKGCONFIG="$PKG_CONFIG"
|
|
|
|
export PYTHONHASHSEED=1
|
|
|
|
'';
|
|
|
|
|
2020-03-31 02:34:20 +00:00
|
|
|
wafPath = "buildtools/bin/waf";
|
2014-04-30 07:42:02 +00:00
|
|
|
|
2023-09-03 01:46:02 +00:00
|
|
|
wafConfigureFlags = [
|
2014-04-30 07:42:02 +00:00
|
|
|
"--bundled-libraries=NONE"
|
|
|
|
"--builtin-libraries=replace"
|
2020-03-31 03:13:44 +00:00
|
|
|
"--without-ldb-lmdb"
|
wafHook: don't add cross compilation flags
These flags are not part of waf, they're custom flags that are not
widely implemented. More packages are broken because of these flags
being added than actually recognise them.
Of the packages in Nixpkgs that directly depend on wafHook that we can
attempt to cross compile (i.e. all their dependencies cross compile),
5 already successfully cross compile and recognise these flags, 2
already successfully cross compile because they have been opted out of
these flags, 3 don't cross compile successfully for reasons unrelated
to these flags, and for the remaining 7, the only thing stopping them
cross compiling successfully is that they are being passed these flags
that they don't recognise.
All of the five successfully cross-compiling packages that do
recognise these flags are samba projects: ldb, talloc, tdb, tevent,
and samba4. So this isn't a general waf convention, just a samba one.
It therefore doesn't make sense to set these flags by default. They
should just be included in the expressions for each samba project,
like all the other quirks common to samba build systems.
This change fixes cross compilation of the following packages:
blockhash ganv ndn-cxx mda_lv2 pflask raul saldl
2024-05-09 16:41:48 +00:00
|
|
|
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
|
|
|
"--cross-compile"
|
|
|
|
"--cross-execute=${stdenv.hostPlatform.emulator buildPackages}"
|
2014-04-30 07:42:02 +00:00
|
|
|
];
|
|
|
|
|
ldb: copy cross fix from tevent
Saw the following while building on an x86_64-linux host for an
armv6l-linux target:
```
Testing pyembed configuration: Could not build a python embedded interpreter
```
I dug into the config log and this seemed to be cause of the issue:
```
['armv6l-unknown-linux-gnueabihf-gcc', '-MMD', '-D_GNU_SOURCE=1', '-D_XOPEN_SOURCE_EXTENDED=1', '-g', '-fwrapv', '-O3',
'-I/nix/store/0pyymzxf7n0fzpaqnvwv92ab72v3jq8d-python3-3.10.9/include/python3.10', '-I/nix/store/kaiinm7cjirmv4zd3pdqa
r23rsypfqlh-libxcrypt-4.4.33/include', '-DNDEBUG', '../../test.c', '-c', '-o/build/ldb-2.6.1/bin/.conf_check_59d3a0a5b9
6e327858e281d280fec4ed/testbuild/default/test.c.1.o']
err: In file included from /nix/store/0pyymzxf7n0fzpaqnvwv92ab72v3jq8d-python3-3.10.9/include/python3.10/Python.h:8,
from ../../test.c:432:
/nix/store/0pyymzxf7n0fzpaqnvwv92ab72v3jq8d-python3-3.10.9/include/python3.10/pyconfig.h:1480: warning: "SIZEOF_LONG" r
edefined
1480 | #define SIZEOF_LONG 8
|
../../test.c:154: note: this is the location of the previous definition
154 | #define SIZEOF_LONG 4
|
/nix/store/0pyymzxf7n0fzpaqnvwv92ab72v3jq8d-python3-3.10.9/include/python3.10/pyconfig.h:1504: warning: "SIZEOF_SIZE_T"
redefined
1504 | #define SIZEOF_SIZE_T 8
|
../../test.c:156: note: this is the location of the previous definition
156 | #define SIZEOF_SIZE_T 4
|
/nix/store/0pyymzxf7n0fzpaqnvwv92ab72v3jq8d-python3-3.10.9/include/python3.10/pyconfig.h:1507: warning: "SIZEOF_TIME_T" redefined
1507 | #define SIZEOF_TIME_T 8
|
../../test.c:170: note: this is the location of the previous definition
170 | #define SIZEOF_TIME_T 4
|
/nix/store/0pyymzxf7n0fzpaqnvwv92ab72v3jq8d-python3-3.10.9/include/python3.10/pyconfig.h:1513: warning: "SIZEOF_VOID_P" redefined
1513 | #define SIZEOF_VOID_P 8
|
../../test.c:166: note: this is the location of the previous definition
166 | #define SIZEOF_VOID_P 4
|
In file included from /nix/store/0pyymzxf7n0fzpaqnvwv92ab72v3jq8d-python3-3.10.9/include/python3.10/Python.h:50:
/nix/store/0pyymzxf7n0fzpaqnvwv92ab72v3jq8d-python3-3.10.9/include/python3.10/pyport.h:746:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
746 | #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
| ^~~~~
```
2023-02-20 17:34:25 +00:00
|
|
|
# python-config from build Python gives incorrect values when cross-compiling.
|
|
|
|
# If python-config is not found, the build falls back to using the sysconfig
|
|
|
|
# module, which works correctly in all cases.
|
|
|
|
PYTHON_CONFIG = "/invalid";
|
|
|
|
|
2020-04-07 03:32:19 +00:00
|
|
|
stripDebugList = [ "bin" "lib" "modules" ];
|
2016-09-19 13:33:35 +00:00
|
|
|
|
2024-04-06 11:25:17 +00:00
|
|
|
passthru.tests.pkg-config = testers.hasPkgConfigModules {
|
|
|
|
package = finalAttrs.finalPackage;
|
|
|
|
};
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2022-05-28 13:38:40 +00:00
|
|
|
broken = stdenv.hostPlatform.isDarwin;
|
2016-06-20 10:53:46 +00:00
|
|
|
description = "LDAP-like embedded database";
|
2020-03-31 02:34:20 +00:00
|
|
|
homepage = "https://ldb.samba.org/";
|
2014-04-30 07:42:02 +00:00
|
|
|
license = licenses.lgpl3Plus;
|
2024-04-06 11:25:17 +00:00
|
|
|
pkgConfigModules = [ "ldb" ];
|
2014-04-30 07:42:02 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
2024-04-06 11:25:17 +00:00
|
|
|
})
|