1{
2 lib,
3 stdenv,
4 fetchurl,
5 pkg-config,
6 glib,
7 libIDL,
8 libintl,
9 buildPackages,
10}:
11
12stdenv.mkDerivation rec {
13 pname = "ORBit2";
14 version = "2.14.19";
15
16 src = fetchurl {
17 url = "mirror://gnome/sources/ORBit2/${lib.versions.majorMinor version}/ORBit2-${version}.tar.bz2";
18 sha256 = "0l3mhpyym9m5iz09fz0rgiqxl2ym6kpkwpsp1xrr4aa80nlh1jam";
19 };
20
21 strictDeps = true;
22
23 # Processing file orbit-interface.idl
24 # sh: gcc: not found
25 # output does not contain binaries for build
26 depsBuildBuild = [ buildPackages.stdenv.cc ];
27 nativeBuildInputs = [
28 pkg-config
29 libintl
30 ];
31 propagatedBuildInputs = [
32 glib
33 libIDL
34 ];
35
36 outputs = [
37 "out"
38 "dev"
39 ];
40
41 env.NIX_CFLAGS_COMPILE = toString (
42 lib.optionals (stdenv.cc.isGNU && (lib.versionAtLeast (lib.getVersion stdenv.cc.cc) "14")) [
43 # the ./configure script is not compatible with gcc-14, not easy to
44 # regenerate without porting: https://github.com/NixOS/nixpkgs/issues/367694
45 "-Wno-error=implicit-int"
46 "-Wno-error=incompatible-pointer-types"
47 ]
48 );
49
50 configureFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
51 "--with-idl-compiler=${lib.getExe' buildPackages.gnome2.ORBit2 "orbit-idl-2"}"
52 # https://github.com/void-linux/void-packages/blob/e5856e02aa6ef7e4f2725afbff2915f89d39024b/srcpkgs/ORBit2/template#L17-L35
53 "ac_cv_alignof_CORBA_boolean=1"
54 "ac_cv_alignof_CORBA_char=1"
55 "ac_cv_alignof_CORBA_double=8"
56 "ac_cv_alignof_CORBA_float=4"
57 "ac_cv_alignof_CORBA_long=4"
58 "ac_cv_alignof_CORBA_long_double=8"
59 "ac_cv_alignof_CORBA_long_long=8"
60 "ac_cv_alignof_CORBA_octet=1"
61 "ac_cv_alignof_CORBA_short=2"
62 "ac_cv_alignof_CORBA_struct=1"
63 "ac_cv_alignof_CORBA_wchar=2"
64 "ac_cv_alignof_CORBA_pointer=${if stdenv.hostPlatform.is64bit then "8" else "4"}"
65 ];
66
67 preBuild = ''
68 sed 's/-DG_DISABLE_DEPRECATED//' -i linc2/src/Makefile
69 '';
70
71 preFixup = ''
72 moveToOutput "bin/orbit2-config" "$dev"
73 '';
74
75 # Parallel build fails due to missing internal library dependency:
76 # libtool --tag=CC --mode=link gcc ... -o orbit-name-server-2 ...
77 # ld: cannot find libname-server-2.a: No such file or directory
78 # It happens because orbit-name-server-2 should have libname-server-2.a
79 # in _DEPENDENCIES but does not. Instead of fixing it and regenerating
80 # Makefile.in let's just disable parallel build.
81 enableParallelBuilding = false;
82
83 meta = with lib; {
84 homepage = "https://developer-old.gnome.org/ORBit2/";
85 description = "CORBA 2.4-compliant Object Request Broker";
86 platforms = platforms.unix;
87 maintainers = with maintainers; [ lovek323 ];
88
89 longDescription = ''
90 ORBit2 is a CORBA 2.4-compliant Object Request Broker (ORB) featuring
91 mature C, C++ and Python bindings. Bindings (in various degrees of
92 completeness) are also available for Perl, Lisp, Pascal, Ruby, and TCL;
93 others are in-progress. It supports POA, DII, DSI, TypeCode, Any, IR and
94 IIOP. Optional features including INS and threading are available. ORBit2
95 is engineered for the desktop workstation environment, with a focus on
96 performance, low resource usage, and security. The core ORB is written in
97 C, and runs under Linux, UNIX (BSD, Solaris, HP-UX, ...), and Windows.
98 ORBit2 is developed and released as open source software under GPL/LGPL.
99 '';
100 };
101}