about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/nanodbc
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-03-15 10:36:38 +0000
committerAlyssa Ross <hi@alyssa.is>2022-03-16 11:37:19 +0000
commitd435710923ac6e6f9fc155534800745004f2ce93 (patch)
tree386f9401476f96bdc6ec25173a090198942b5d5b /nixpkgs/pkgs/development/libraries/nanodbc
parentc725f0011e91ae49d351b981690eb66b862b6104 (diff)
parent3239fd2b8f728106491154b44625662e10259af2 (diff)
downloadnixlib-d435710923ac6e6f9fc155534800745004f2ce93.tar
nixlib-d435710923ac6e6f9fc155534800745004f2ce93.tar.gz
nixlib-d435710923ac6e6f9fc155534800745004f2ce93.tar.bz2
nixlib-d435710923ac6e6f9fc155534800745004f2ce93.tar.lz
nixlib-d435710923ac6e6f9fc155534800745004f2ce93.tar.xz
nixlib-d435710923ac6e6f9fc155534800745004f2ce93.tar.zst
nixlib-d435710923ac6e6f9fc155534800745004f2ce93.zip
Merge commit '3239fd2b8f728106491154b44625662e10259af2'
Conflicts:
	nixpkgs/pkgs/applications/window-managers/sway/default.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/nanodbc')
-rw-r--r--nixpkgs/pkgs/development/libraries/nanodbc/default.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/nanodbc/default.nix b/nixpkgs/pkgs/development/libraries/nanodbc/default.nix
new file mode 100644
index 000000000000..64f362e35202
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nanodbc/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchFromGitHub, cmake, unixODBC }:
+
+stdenv.mkDerivation rec {
+  pname = "nanodbc";
+  version = "2.13.0";
+
+  src = fetchFromGitHub {
+    owner = "nanodbc";
+    repo = "nanodbc";
+    rev = "v${version}";
+    sha256 = "1q80p7yv9mcl4hyvnvcjdr70y8nc940ypf368lp97vpqn5yckkgm";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ unixODBC ];
+
+  cmakeFlags = if (stdenv.hostPlatform.isStatic) then
+    [ "-DBUILD_STATIC_LIBS=ON" ]
+  else
+    [ "-DBUILD_SHARED_LIBS=ON" ];
+
+  # fix compilation on macOS
+  # https://github.com/nanodbc/nanodbc/issues/274
+  # remove after the next version update
+  postUnpack = if stdenv.isDarwin then ''
+    mv $sourceRoot/VERSION $sourceRoot/VERSION.txt
+    substituteInPlace $sourceRoot/CMakeLists.txt \
+       --replace 'file(STRINGS VERSION' 'file(STRINGS VERSION.txt'
+  '' else "";
+
+  meta = with lib; {
+    homepage = "https://github.com/nanodbc/nanodbc";
+    changelog = "https://github.com/nanodbc/nanodbc/raw/v${version}/CHANGELOG.md";
+    description = "Small C++ wrapper for the native C ODBC API";
+    license = licenses.mit;
+    maintainers = [ maintainers.bzizou ];
+  };
+}