Skip to content

Commit 8f4f8dd

Browse files
jfrochesamrose
authored andcommitted
chore: update fmt
1 parent 83a64a8 commit 8f4f8dd

File tree

9 files changed

+362
-231
lines changed

9 files changed

+362
-231
lines changed

nix/ext/gdal.nix

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,14 @@ stdenv.mkDerivation rec {
4747
zlib
4848
];
4949

50-
cmakeFlags =
51-
[
52-
"-DGDAL_USE_INTERNAL_LIBS=OFF"
53-
"-DGEOTIFF_INCLUDE_DIR=${lib.getDev libgeotiff}/include"
54-
"-DGEOTIFF_LIBRARY_RELEASE=${lib.getLib libgeotiff}/lib/libgeotiff${stdenv.hostPlatform.extensions.sharedLibrary}"
55-
"-DBUILD_PYTHON_BINDINGS=OFF"
56-
]
57-
++ lib.optionals (!stdenv.isDarwin) [ "-DCMAKE_SKIP_BUILD_RPATH=ON" ]
58-
++ lib.optionals stdenv.isDarwin [ "-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON" ];
50+
cmakeFlags = [
51+
"-DGDAL_USE_INTERNAL_LIBS=OFF"
52+
"-DGEOTIFF_INCLUDE_DIR=${lib.getDev libgeotiff}/include"
53+
"-DGEOTIFF_LIBRARY_RELEASE=${lib.getLib libgeotiff}/lib/libgeotiff${stdenv.hostPlatform.extensions.sharedLibrary}"
54+
"-DBUILD_PYTHON_BINDINGS=OFF"
55+
]
56+
++ lib.optionals (!stdenv.isDarwin) [ "-DCMAKE_SKIP_BUILD_RPATH=ON" ]
57+
++ lib.optionals stdenv.isDarwin [ "-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON" ];
5958

6059
enableParallelBuilding = true;
6160

nix/ext/pgroonga.nix

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
{
2+
lib,
3+
stdenv,
4+
fetchurl,
5+
pkg-config,
6+
postgresql,
7+
msgpack-c,
8+
mecab,
9+
makeWrapper,
10+
xxHash,
11+
supabase-groonga,
12+
}:
13+
stdenv.mkDerivation rec {
14+
pname = "pgroonga";
15+
version = "3.2.5";
16+
src = fetchurl {
17+
url = "https://packages.groonga.org/source/${pname}/${pname}-${version}.tar.gz";
18+
sha256 = "sha256-GM9EOQty72hdE4Ecq8jpDudhZLiH3pP9ODLxs8DXcSY=";
19+
};
20+
21+
nativeBuildInputs = [
22+
pkg-config
23+
makeWrapper
24+
];
25+
26+
buildInputs = [
27+
postgresql
28+
msgpack-c
29+
supabase-groonga
30+
mecab
31+
]
32+
++ lib.optionals stdenv.isDarwin [ xxHash ];
33+
34+
propagatedBuildInputs = [ supabase-groonga ];
35+
configureFlags = [
36+
"--with-mecab=${mecab}"
37+
"--enable-mecab"
38+
"--with-groonga=${supabase-groonga}"
39+
"--with-groonga-plugin-dir=${supabase-groonga}/lib/groonga/plugins"
40+
];
41+
42+
makeFlags = [
43+
"HAVE_MSGPACK=1"
44+
"MSGPACK_PACKAGE_NAME=msgpack-c"
45+
"HAVE_MECAB=1"
46+
];
47+
48+
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin (
49+
builtins.concatStringsSep " " [
50+
"-Wno-error=incompatible-function-pointer-types"
51+
"-Wno-error=format"
52+
"-Wno-format"
53+
"-I${supabase-groonga}/include/groonga"
54+
"-I${xxHash}/include"
55+
"-DPGRN_VERSION=\"${version}\""
56+
]
57+
);
58+
59+
preConfigure = ''
60+
export GROONGA_LIBS="-L${supabase-groonga}/lib -lgroonga"
61+
export GROONGA_CFLAGS="-I${supabase-groonga}/include"
62+
export MECAB_CONFIG="${mecab}/bin/mecab-config"
63+
${lib.optionalString stdenv.isDarwin ''
64+
export CPPFLAGS="-I${supabase-groonga}/include/groonga -I${xxHash}/include -DPGRN_VERSION=\"${version}\""
65+
export CFLAGS="-I${supabase-groonga}/include/groonga -I${xxHash}/include -DPGRN_VERSION=\"${version}\""
66+
export PG_CPPFLAGS="-Wno-error=incompatible-function-pointer-types -Wno-error=format"
67+
''}
68+
'';
69+
70+
installPhase = ''
71+
mkdir -p $out/lib $out/share/postgresql/extension $out/bin
72+
install -D pgroonga${postgresql.dlSuffix} -t $out/lib/
73+
install -D pgroonga.control -t $out/share/postgresql/extension
74+
install -D data/pgroonga-*.sql -t $out/share/postgresql/extension
75+
install -D pgroonga_database${postgresql.dlSuffix} -t $out/lib/
76+
install -D pgroonga_database.control -t $out/share/postgresql/extension
77+
install -D data/pgroonga_database-*.sql -t $out/share/postgresql/extension
78+
79+
echo "Debug: Groonga plugins directory contents:"
80+
ls -l ${supabase-groonga}/lib/groonga/plugins/tokenizers/
81+
'';
82+
83+
meta = with lib; {
84+
description = "A PostgreSQL extension to use Groonga as the index";
85+
longDescription = ''
86+
PGroonga is a PostgreSQL extension to use Groonga as the index.
87+
PostgreSQL supports full text search against languages that use only alphabet and digit.
88+
It means that PostgreSQL doesn't support full text search against Japanese, Chinese and so on.
89+
You can use super fast full text search feature against all languages by installing PGroonga into your PostgreSQL.
90+
'';
91+
homepage = "https://pgroonga.github.io/";
92+
changelog = "https://github.com/pgroonga/pgroonga/releases/tag/${version}";
93+
license = licenses.postgresql;
94+
platforms = postgresql.meta.platforms;
95+
};
96+
}

nix/ext/pgrouting.nix

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,34 @@ buildEnv {
127127
expectedFiles=${toString (numberOfVersions + 1)}
128128
actualFiles=$(ls -l $out/lib/lib${pname}*${postgresql.dlSuffix} | wc -l)
129129
130+
<<<<<<< HEAD
130131
if [[ "$actualFiles" != "$expectedFiles" ]]; then
131132
echo "Error: Expected $expectedFiles library files, found $actualFiles"
132133
echo "Files found:"
133134
ls -la $out/lib/*${postgresql.dlSuffix} || true
134135
exit 1
135136
fi
137+
=======
138+
#disable compile time warnings for incompatible pointer types only on macos and pg16
139+
NIX_CFLAGS_COMPILE = lib.optionalString (
140+
stdenv.isDarwin && lib.versionAtLeast postgresql.version "16"
141+
) "-Wno-error=int-conversion -Wno-error=incompatible-pointer-types";
142+
143+
cmakeFlags = [
144+
"-DPOSTGRESQL_VERSION=${postgresql.version}"
145+
]
146+
++ lib.optionals (stdenv.isDarwin && lib.versionAtLeast postgresql.version "16") [
147+
"-DCMAKE_MACOSX_RPATH=ON"
148+
"-DCMAKE_SHARED_MODULE_SUFFIX=.dylib"
149+
"-DCMAKE_SHARED_LIBRARY_SUFFIX=.dylib"
150+
];
151+
152+
preConfigure = lib.optionalString (stdenv.isDarwin && lib.versionAtLeast postgresql.version "16") ''
153+
export DLSUFFIX=.dylib
154+
export CMAKE_SHARED_LIBRARY_SUFFIX=.dylib
155+
export CMAKE_SHARED_MODULE_SUFFIX=.dylib
156+
export MACOSX_RPATH=ON
157+
>>>>>>> 4847adac (chore: update fmt)
136158
'';
137159
138160
passthru = {

nix/ext/plv8.nix

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -37,38 +37,37 @@ stdenv.mkDerivation (finalAttrs: {
3737
./0001-build-Allow-using-V8-from-system.patch
3838
];
3939

40-
nativeBuildInputs =
41-
[ perl ]
42-
++ lib.optionals stdenv.isDarwin [
43-
clang
44-
xcbuild
45-
];
40+
nativeBuildInputs = [
41+
perl
42+
]
43+
++ lib.optionals stdenv.isDarwin [
44+
clang
45+
xcbuild
46+
];
4647

47-
buildInputs =
48-
[
49-
v8
50-
postgresql
51-
]
52-
++ lib.optionals stdenv.isDarwin [
53-
darwin.apple_sdk.frameworks.CoreFoundation
54-
darwin.apple_sdk.frameworks.Kerberos
55-
];
48+
buildInputs = [
49+
v8
50+
postgresql
51+
]
52+
++ lib.optionals stdenv.isDarwin [
53+
darwin.apple_sdk.frameworks.CoreFoundation
54+
darwin.apple_sdk.frameworks.Kerberos
55+
];
5656

5757
buildFlags = [ "all" ];
5858

59-
makeFlags =
60-
[
61-
# Nixpkgs build a v8 monolith instead of separate v8_libplatform.
62-
"USE_SYSTEM_V8=1"
63-
"V8_OUTDIR=${v8}/lib"
64-
"PG_CONFIG=${postgresql}/bin/pg_config"
65-
]
66-
++ lib.optionals stdenv.isDarwin [
67-
"CC=${clang}/bin/clang"
68-
"CXX=${clang}/bin/clang++"
69-
"SHLIB_LINK=-L${v8}/lib -lv8_monolith -Wl,-rpath,${v8}/lib"
70-
]
71-
++ lib.optionals (!stdenv.isDarwin) [ "SHLIB_LINK=-lv8" ];
59+
makeFlags = [
60+
# Nixpkgs build a v8 monolith instead of separate v8_libplatform.
61+
"USE_SYSTEM_V8=1"
62+
"V8_OUTDIR=${v8}/lib"
63+
"PG_CONFIG=${postgresql}/bin/pg_config"
64+
]
65+
++ lib.optionals stdenv.isDarwin [
66+
"CC=${clang}/bin/clang"
67+
"CXX=${clang}/bin/clang++"
68+
"SHLIB_LINK=-L${v8}/lib -lv8_monolith -Wl,-rpath,${v8}/lib"
69+
]
70+
++ lib.optionals (!stdenv.isDarwin) [ "SHLIB_LINK=-lv8" ];
7271

7372
NIX_LDFLAGS = (
7473
lib.optionals stdenv.isDarwin [

nix/ext/postgis.nix

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,32 @@ let
4848
"postgis_topology"
4949
];
5050

51+
<<<<<<< HEAD
5152
sqlExtensions = [
5253
"address_standardizer_data_us"
5354
"postgis_tiger_geocoder"
55+
=======
56+
src = fetchurl {
57+
url = "https://download.osgeo.org/postgis/source/postgis-${version}.tar.gz";
58+
sha256 = "sha256-UHJKDd5JrcJT5Z4CTYsY/va+ToU0GUPG1eHhuXTkP84=";
59+
};
60+
61+
buildInputs = [
62+
libxml2
63+
postgresql
64+
geos
65+
proj
66+
gdal
67+
json_c
68+
protobufc
69+
pcre2.dev
70+
sfcgal
71+
]
72+
++ lib.optional stdenv.isDarwin libiconv;
73+
nativeBuildInputs = [
74+
perl
75+
pkg-config
76+
>>>>>>> 4847adac (chore: update fmt)
5477
];
5578

5679
# Build function for individual versions

nix/ext/wrappers/default.nix

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,15 @@ let
3737
cargo
3838
git
3939
];
40-
buildInputs =
41-
[
42-
openssl
43-
postgresql
44-
]
45-
++ lib.optionals stdenv.isDarwin [
46-
darwin.apple_sdk.frameworks.CoreFoundation
47-
darwin.apple_sdk.frameworks.Security
48-
darwin.apple_sdk.frameworks.SystemConfiguration
49-
];
40+
buildInputs = [
41+
openssl
42+
postgresql
43+
]
44+
++ lib.optionals stdenv.isDarwin [
45+
darwin.apple_sdk.frameworks.CoreFoundation
46+
darwin.apple_sdk.frameworks.Security
47+
darwin.apple_sdk.frameworks.SystemConfiguration
48+
];
5049

5150
NIX_LDFLAGS = "-L${postgresql}/lib -lpq";
5251

nix/packages/groonga/default.nix

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,20 @@ stdenv.mkDerivation (finalAttrs: {
3636
pkg-config
3737
makeWrapper
3838
];
39-
buildInputs =
40-
[
41-
rapidjson
42-
xxHash
43-
zstd
44-
mecab
45-
kytea
46-
msgpack-c
47-
]
48-
++ lib.optionals lz4Support [ lz4 ]
49-
++ lib.optional zlibSupport [ zlib ]
50-
++ lib.optionals suggestSupport [
51-
zeromq
52-
libevent
53-
];
39+
buildInputs = [
40+
rapidjson
41+
xxHash
42+
zstd
43+
mecab
44+
kytea
45+
msgpack-c
46+
]
47+
++ lib.optionals lz4Support [ lz4 ]
48+
++ lib.optional zlibSupport [ zlib ]
49+
++ lib.optionals suggestSupport [
50+
zeromq
51+
libevent
52+
];
5453
cmakeFlags = [
5554
"-DWITH_MECAB=ON"
5655
"-DMECAB_DICDIR=${mecab-naist-jdic}/lib/mecab/dic/naist-jdic"

nix/packages/lib.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@
9595
PGBOUNCER_AUTH_SCHEMA_SQL = "${paths.pgbouncerAuthSchemaSql}";
9696
STAT_EXTENSION_SQL = "${paths.statExtensionSql}";
9797
CURRENT_SYSTEM = "${system}";
98-
} // extraSubstitutions; # Merge in any extra substitutions
98+
}
99+
// extraSubstitutions; # Merge in any extra substitutions
99100
in
100101
pkgs.runCommand name
101102
{

0 commit comments

Comments
 (0)