From 912e7ab90d83292d939452d2aa3d5e56def37c4f Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Mon, 11 Dec 2023 19:31:46 +0100 Subject: [PATCH] ode: refactor, add darwin support --- pkgs/development/libraries/ode/default.nix | 29 ++++++++++++++++------ 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/pkgs/development/libraries/ode/default.nix b/pkgs/development/libraries/ode/default.nix index d35976932663..6ae60b7b2d3a 100644 --- a/pkgs/development/libraries/ode/default.nix +++ b/pkgs/development/libraries/ode/default.nix @@ -1,18 +1,33 @@ -{ lib, stdenv, fetchurl }: +{ lib +, stdenv +, fetchurl +, darwin +}: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "ode"; version = "0.16.4"; src = fetchurl { - url = "https://bitbucket.org/odedevs/${pname}/downloads/${pname}-${version}.tar.gz"; - sha256 = "sha256-cQN7goHGyGsKVXKfkNXbaXq+TL7B2BGBV+ANSOwlNGc="; + url = "https://bitbucket.org/odedevs/ode/downloads/ode-${finalAttrs.version}.tar.gz"; + hash = "sha256-cQN7goHGyGsKVXKfkNXbaXq+TL7B2BGBV+ANSOwlNGc="; }; + buildInputs = lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.CoreServices + darwin.apple_sdk.frameworks.GLUT + ]; + + env.CXXFLAGS = lib.optionalString stdenv.cc.isClang (toString [ + "-std=c++14" + "-Wno-error=c++11-narrowing" + ]); + meta = with lib; { description = "Open Dynamics Engine"; homepage = "https://www.ode.org"; - platforms = platforms.linux; - license = with licenses; [ bsd3 lgpl21 lgpl3 zlib ]; + license = with licenses; [ bsd3 lgpl21Only lgpl3Only zlib ]; + maintainers = with maintainers; [ wegank ]; + platforms = platforms.unix; }; -} +})