default.nix (1403B)
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 src = fetchFromGitHub { 29 owner = "clarisma"; 30 repo = "libgeodesk"; 31 tag = "v${finalAttrs.version}"; 32 hash = "sha256-OIwYudqTPWIcyh7rpcM1ThPgBfsrTu6REWdTxkC86I0="; 33 }; 34 35 patches = [ 36 (replaceVars ./remove-fetchcontent-usage.patch { 37 # We will download them instead of cmake's fetchContent 38 inherit catch2Src gtlSrc; 39 }) 40 ]; 41 42 nativeBuildInputs = [ cmake ]; 43 44 buildInputs = [ geos ]; 45 46 cmakeFlags = [ 47 (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) 48 (lib.cmakeBool "GEODESK_WITH_GEOS" true) 49 (lib.cmakeFeature "GEOS_INCLUDE_PATHS" "${geos}/include") 50 ]; 51 52 meta = { 53 description = "Fast and storage-efficient spatial database engine for OpenStreetMap data"; 54 homepage = "https://github.com/clarisma/libgeodesk"; 55 license = lib.licenses.lgpl3Only; 56 maintainers = [ lib.maintainers.sikmir ]; 57 platforms = lib.platforms.unix; 58 }; 59 })