package.nix (1432B)
1 { 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 cmake, 6 geos, 7 replaceVars, 8 }: 9 10 let 11 catch2Src = fetchFromGitHub { 12 owner = "catchorg"; 13 repo = "Catch2"; 14 tag = "v3.7.1"; 15 hash = "sha256-Zt53Qtry99RAheeh7V24Csg/aMW25DT/3CN/h+BaeoM="; 16 }; 17 gtlSrc = fetchFromGitHub { 18 owner = "greg7mdp"; 19 repo = "gtl"; 20 tag = "v1.2.0"; 21 hash = "sha256-kSmHgcaCZDNgNZdGqacrUa7d6iTtDm9BVazXUPnI5Zc="; 22 }; 23 in 24 stdenv.mkDerivation (finalAttrs: { 25 pname = "libgeodesk"; 26 version = "2.0.0"; 27 28 __structuredAttrs = true; 29 30 src = fetchFromGitHub { 31 owner = "clarisma"; 32 repo = "libgeodesk"; 33 tag = "v${finalAttrs.version}"; 34 hash = "sha256-OIwYudqTPWIcyh7rpcM1ThPgBfsrTu6REWdTxkC86I0="; 35 }; 36 37 patches = [ 38 (replaceVars ./remove-fetchcontent-usage.patch { 39 # We will download them instead of cmake's fetchContent 40 inherit catch2Src gtlSrc; 41 }) 42 ]; 43 44 nativeBuildInputs = [ cmake ]; 45 46 buildInputs = [ geos ]; 47 48 cmakeFlags = [ 49 (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) 50 (lib.cmakeBool "GEODESK_WITH_GEOS" true) 51 (lib.cmakeFeature "GEOS_INCLUDE_PATHS" "${geos}/include") 52 ]; 53 54 meta = { 55 description = "Fast and storage-efficient spatial database engine for OpenStreetMap data"; 56 homepage = "https://github.com/clarisma/libgeodesk"; 57 license = lib.licenses.lgpl3Only; 58 maintainers = [ lib.maintainers.sikmir ]; 59 platforms = lib.platforms.unix; 60 }; 61 })
