Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Fix Darwin Support #10

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions pkgs/by-name/al/all-cabal-hashes/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Hackage database snapshot, used by maintainers/scripts/regenerate-hackage-packages.sh
# and callHackage
{ lib, fetchurl }:
let
pin = lib.importJSON ./pin.json;
in
fetchurl {
inherit (pin) url sha256;
name = "all-cabal-hashes-${lib.substring 0 7 pin.commit}.tar.gz";
passthru.updateScript = ../../../../maintainers/scripts/haskell/update-hackage.sh;
}
6 changes: 6 additions & 0 deletions pkgs/by-name/al/all-cabal-hashes/pin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"commit": "4eb9a5fde06b5d7343665582243debaf1d77e0a9",
"url": "https://github.com/commercialhaskell/all-cabal-hashes/archive/4eb9a5fde06b5d7343665582243debaf1d77e0a9.tar.gz",
"sha256": "0dzyfr1gv79riy2vh840b5hqly8rs10zhj01zi9nfn7jd9pzql28",
"msg": "Update from Hackage at 2024-04-16T17:36:35Z"
}
25 changes: 25 additions & 0 deletions pkgs/by-name/ar/argp-standalone/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{ lib, stdenv, fetchFromGitHub, meson, ninja }:

stdenv.mkDerivation rec {
pname = "argp-standalone";
version = "1.5.0";

src = fetchFromGitHub {
owner = "argp-standalone";
repo = "argp-standalone";
rev = version;
sha256 = "jWnoWVnUVDQlsC9ru7oB9PdtZuyCCNqGnMqF/f2m0ZY=";
};

nativeBuildInputs = [ meson ninja ];

doCheck = true;

meta = with lib; {
homepage = "https://github.com/argp-standalone/argp-standalone";
description = "Standalone version of arguments parsing functions from Glibc";
platforms = platforms.unix;
maintainers = with maintainers; [ amar1729 ];
license = licenses.lgpl21Plus;
};
}
2 changes: 1 addition & 1 deletion pkgs/by-name/bi/binutils/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ with pkgs;
inherit (stdenv.targetPlatform) linker;
in
if linker == "lld" then llvmPackages.bintools-unwrapped
# else if linker == "cctools" then darwin.binutils-unwrapped
else if linker == "cctools" then darwin.binutils-unwrapped
else if linker == "bfd" then binutils-unwrapped
else if linker == "gold" then binutils-unwrapped.override { enableGoldDefault = true; }
else null;
Expand Down
5 changes: 3 additions & 2 deletions pkgs/by-name/bo/boehmgc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ stdenv.mkDerivation (finalAttrs: {
"CFLAGS_EXTRA=-DNO_SOFT_VDB"
];

# `gctest` fails under emulation on aarch64-darwin
doCheck = !(stdenv.isDarwin && stdenv.isx86_64);
# `gctest` fails under x86_64 emulation on aarch64-darwin
# and also on aarch64-linux (qemu-user)
doCheck = !((stdenv.isDarwin && stdenv.isx86_64) || (stdenv.isLinux && stdenv.isAarch64));

enableParallelBuilding = true;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/cm/cmake/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,6 @@ stdenv.mkDerivation (finalAttrs: {
maintainers = with lib.maintainers; [ ttuegel lnl7 AndersonTorres ];
platforms = lib.platforms.all;
mainProgram = "cmake";
broken = (/*qt5UI &&*/ stdenv.isDarwin);
# broken = (qt5UI && stdenv.isDarwin);
};
})
56 changes: 56 additions & 0 deletions pkgs/by-name/cm/cmocka/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{ fetchurl, fetchpatch, lib, stdenv, cmake }:

stdenv.mkDerivation rec {
pname = "cmocka";
majorVersion = "1.1";
version = "${majorVersion}.7";

src = fetchurl {
url = "https://cmocka.org/files/${majorVersion}/cmocka-${version}.tar.xz";
sha256 = "sha256-gQVw6wuNZIBDMfgrKf9Hx5DOnNaxY+mNR6SAcEfsrYI=";
};

patches = [
./uintptr_t.patch
];

nativeBuildInputs = [ cmake ];

cmakeFlags = lib.optional doCheck "-DUNIT_TESTING=ON"
++ lib.optional stdenv.hostPlatform.isStatic "-DBUILD_SHARED_LIBS=OFF";

doCheck = true;

meta = with lib; {
description = "Lightweight library to simplify and generalize unit tests for C";
longDescription = ''
There are a variety of C unit testing frameworks available however
many of them are fairly complex and require the latest compiler
technology. Some development requires the use of old compilers which
makes it difficult to use some unit testing frameworks. In addition
many unit testing frameworks assume the code being tested is an
application or module that is targeted to the same platform that will
ultimately execute the test. Because of this assumption many
frameworks require the inclusion of standard C library headers in the
code module being tested which may collide with the custom or
incomplete implementation of the C library utilized by the code under
test.

Cmocka only requires a test application is linked with the standard C
library which minimizes conflicts with standard C library headers.
Also, CMocka tries to avoid the use of some of the newer features of
C compilers.

This results in CMocka being a relatively small library that can be
used to test a variety of exotic code. If a developer wishes to
simply test an application with the latest compiler then other unit
testing frameworks may be preferable.

This is the successor of Google's Cmockery.
'';
homepage = "https://cmocka.org/";
license = licenses.asl20;
platforms = platforms.all;
maintainers = with maintainers; [ kragniz rasendubi ];
};
}
16 changes: 16 additions & 0 deletions pkgs/by-name/cm/cmocka/uintptr_t.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Resolve messy situation with uintptr_t and stdint.h

Platforms common in nixpkgs will have stdint.h - thereby we avoid problems
that seem complicated to avoid. References:
https://gitlab.com/cmocka/cmocka/-/issues/38#note_1286565655
https://git.alpinelinux.org/aports/plain/main/cmocka/musl_uintptr.patch?id=6a15dd0d0ba9cc354a621fb359ca5e315ff2eabd

It isn't easy, as 1.1.6 codebase is missing stdint.h includes on many places,
and HAVE_UINTPTR_T from cmake also wouldn't get on all places it needs to.
--- a/include/cmocka.h
+++ b/include/cmocka.h
@@ -18,2 +18,4 @@
#define CMOCKA_H_
+#include <stdint.h>
+#define HAVE_UINTPTR_T 1

44 changes: 44 additions & 0 deletions pkgs/by-name/ct/ctags/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{ lib, stdenv, fetchsvn, autoreconfHook }:

stdenv.mkDerivation rec {
pname = "ctags";
version = "816";

src = fetchsvn {
url = "https://svn.code.sf.net/p/ctags/code/trunk";
rev = version;
sha256 = "0jmbkrmscbl64j71qffcc39x005jrmphx8kirs1g2ws44wil39hf";
};

nativeBuildInputs = [ autoreconfHook ];

# don't use $T(E)MP which is set to the build directory
configureFlags= [ "--enable-tmpdir=/tmp" ];

patches = [
# Library defines an `__unused__` which is a reserved name, and may
# conflict with the standard library definition. One such conflict is with
# macOS headers.
./unused-collision.patch
];

meta = with lib; {
description = "A tool for fast source code browsing (exuberant ctags)";
mainProgram = "ctags";
longDescription = ''
Ctags generates an index (or tag) file of language objects found
in source files that allows these items to be quickly and easily
located by a text editor or other utility. A tag signifies a
language object for which an index entry is available (or,
alternatively, the index entry created for that object). Many
programming languages are supported.
'';
homepage = "https://ctags.sourceforge.net/";
license = licenses.gpl2Plus;
platforms = platforms.unix;

# So that Exuberant ctags is preferred over emacs's ctags
priority = 1;
};

}
Loading