this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #372 from andyneff/rpm

WIP: Adding rpm for darling

authored by

Andrew Hyatt and committed by
GitHub
d2cc5fa7 ba5323c8

+180
+4
.gitignore
··· 34 34 35 35 # The suggested build folder 36 36 build 37 + 38 + rpm/SOURCES 39 + rpm/RPMS 40 + rpm/SRPMS
+1
rpm/.dockerignore
··· 1 + SOURCES
+20
rpm/Dockerfile
··· 1 + ARG OS=fedora:27 2 + FROM ${OS} 3 + 4 + SHELL ["bash", "-euxvc"] 5 + 6 + RUN dnf install -y rpm-build dnf-utils rpmdevtools;\ 7 + dnf clean all 8 + 9 + # Bootstrap 10 + RUN dnf install -y bison cairo-devel clang cmake dkms flex fontconfig-devel \ 11 + fontconfig-devel.i686 freetype-devel freetype-devel.i686 \ 12 + fuse-devel glibc-devel glibc-devel.i686 kernel-devel \ 13 + libglvnd-devel libjpeg-turbo-devel libjpeg-turbo-devel.i686 \ 14 + libtiff-devel libtiff-devel.i686 mesa-libGL-devel python2 \ 15 + systemd-devel;\ 16 + dnf clean all 17 + 18 + RUN mkdir -p /root/rpmbuild/SOURCES 19 + 20 + CMD bash -xv /src/rpm/build.bsh
+18
rpm/README.md
··· 1 + # Building RPMs 2 + 3 + 1. Install `docker` and `docker-compose` 4 + 2. `cd rpm` 5 + 3. `docker-compose run rpm` 6 + 4. Now you can run `dnf install RPMS/x84_64/darling*.rpm` 7 + 5. `setsebool -P mmap_low_allowed 1` to allow darling low level access and run 8 + 9 + ## Building on other operating systems 10 + 11 + By default, it will build for Fedora 27. To use a different OS, simply 12 + 13 + RPM_OS=fedora:26 14 + 15 + ## Future improvements 16 + 17 + - Everything is based off of dnf. Supporting zypper and yum will reach others 18 + - Because of the way the submodules are handled, this isn't quite ready for releasing but this can be solved using [%autosetup in the %prep to checkout the submodules.](https://fedoraproject.org/wiki/Packaging:SourceURL#Git_Submodules)
+9
rpm/SOURCES/dkms.conf
··· 1 + PACKAGE_NAME=darling-mach 2 + PACKAGE_VERSION=0.1 3 + BUILT_MODULE_NAME="$PACKAGE_NAME" 4 + BUILT_MODULE_LOCATION=lkm/ 5 + DEST_MODULE_LOCATION[0]=/extra 6 + MAKE[0]="'make' -C lkm/ MIGDIR=/usr/src/${PACKAGE_NAME}-${PACKAGE_VERSION}/miggen MIGDIR_REL=../miggen" 7 + CLEAN="'make' -C lkm/ MIGDIR=/usr/src/${PACKAGE_NAME}-${PACKAGE_VERSION}/miggen MIGDIR_REL=../miggen clean" 8 + REMAKE_INITRD=no 9 + AUTOINSTALL=yes
+93
rpm/SPECS/darling.spec
··· 1 + #disable binary striping, in case this is a problem 2 + %global __os_install_post %{nil} 3 + #Disable debug packages, since these are emulated files mostly 4 + %define debug_package %{nil} 5 + 6 + Name: darling 7 + Version: 0.1 8 + Release: 1%{?dist} 9 + Summary: Darling 10 + 11 + Group: Utility 12 + License: GPLv3 13 + URL: https://www.darlinghq.org/ 14 + # Source0: https://github.com/darlinghq/darling/archive/%%{version}/%%{name}-%%{version}.tar.gz 15 + Source0: %{name}.tar.gz 16 + Source1: dkms.conf 17 + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) 18 + 19 + BuildRequires: cmake clang bison flex python2 glibc-devel(x86-64) glibc-devel(x86-32) 20 + BuildRequires: fuse-devel systemd-devel kernel-devel dkms 21 + BuildRequires: cairo-devel freetype-devel(x86-64) fontconfig-devel(x86-64) 22 + BuildRequires: freetype-devel(x86-32) fontconfig-devel(x86-32) 23 + BuildRequires: libjpeg-turbo-devel(x86-64) libtiff-devel(x86-64) 24 + BuildRequires: libjpeg-turbo-devel(x86-32) libtiff-devel(x86-32) 25 + BuildRequires: libglvnd-devel mesa-libGL-devel 26 + 27 + #It will pick up all the mac pieces as dependencies. No thank you! 28 + AutoReqProv: no 29 + 30 + %description 31 + Darling macOS emulator 32 + 33 + %package mach 34 + Summary: Darling mach dkms module 35 + Group: Utility 36 + Requires: dkms make gcc kernel-devel 37 + AutoReqProv: no 38 + 39 + %description mach 40 + Linux kernel module for darling-mach 41 + 42 + %prep 43 + %setup -q -n %{name} 44 + 45 + %build 46 + %{__mkdir_p} build 47 + pushd build 48 + # Release is broken https://github.com/darlinghq/darling/issues/331 49 + # -DCMAKE_BUILD_TYPE=Release \ 50 + %{__cmake} -DCMAKE_INSTALL_PREFIX=/usr \ 51 + .. 52 + %{make_build} 53 + popd 54 + 55 + %install 56 + [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT 57 + pushd build 58 + %{make_install} 59 + %{make_build} lkm_generate 60 + popd 61 + %{__install} -d -m 755 %{?buildroot}/usr/src/%{name}-mach-%{version}/miggen 62 + cp -dr --no-preserve=ownership src/lkm %{?buildroot}/usr/src/%{name}-mach-%{version}/lkm 63 + cp -dr --no-preserve=ownership build/src/lkm/osfmk %{?buildroot}/usr/src/%{name}-mach-%{version}/miggen/osfmk 64 + %{__install} -m 644 %{SOURCE1} %{?buildroot}/usr/src/%{name}-mach-%{version} 65 + 66 + %post 67 + setcap cap_sys_rawio=ep %{_libexecdir}/darling/bin/mldr 68 + setcap cap_sys_rawio=ep %{_libexecdir}/darling/bin/mldr32 69 + 70 + #setsebool -P mmap_low_allowed 1 71 + 72 + %preun mach 73 + /usr/sbin/dkms remove -m %{name}-mach -v %{version} --all 74 + 75 + %post mach 76 + occurrences=$(/usr/sbin/dkms status | grep "%{name}" | grep "%{version}" | wc -l) 77 + if [ ! ${occurrences} -gt 0 ]; 78 + then 79 + /usr/sbin/dkms add -m %{name}-mach -v %{version} 80 + fi 81 + /usr/sbin/dkms build -m %{name}-mach -v %{version} 82 + /usr/sbin/dkms install -m %{name}-mach -v %{version} 83 + 84 + %files 85 + %doc LICENSE 86 + %{_bindir}/darling 87 + %{_libexecdir}/darling 88 + 89 + %files mach 90 + %{_sysconfdir}/udev/rules.d/00-darling-mach.rules 91 + %{_prefix}/src/%{name}-mach-%{version} 92 + 93 + %changelog
+14
rpm/build.bsh
··· 1 + #!/usr/bin/env bash 2 + 3 + set -eu 4 + 5 + yum-builddep -y /src/rpm/SPECS/darling.spec 6 + if [ -e "/src/rpm/SOURCES/darling.tar.gz" ]; then 7 + ln -s /src/rpm/SOURCES/darling.tar.gz /root/rpmbuild/SOURCES/ 8 + else 9 + # Preparing tarball 10 + tar --transform "s|^\./|/darling/|" -cf /root/rpmbuild/SOURCES/darling.tar.gz -C /src --exclude=.git --exclude SOURCES . 11 + fi 12 + ln -s /src/rpm/SOURCES/dkms.conf /root/rpmbuild/SOURCES/ 13 + #spectool -g -R /src/rpm/SPECS/darling.spec 14 + rpmbuild -ba /src/rpm/SPECS/darling.spec
+12
rpm/docker-compose.yml
··· 1 + version: "2.3" 2 + 3 + services: 4 + rpm: 5 + build: 6 + context: . 7 + args: 8 + - OS=${RPM_OS-fedora:27} 9 + volumes: 10 + - ..:/src:ro 11 + - ./RPMS:/root/rpmbuild/RPMS 12 + - ./SRPMS:/root/rpmbuild/SRPMS
+9
rpm/tarup.bsh
··· 1 + #!/usr/bin/env bash 2 + 3 + set -euxv 4 + 5 + CWD="$(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd)" 6 + if [ -e "${CWD}/SOURCES/darling.tar.gz" ]; then 7 + rm "${CWD}/SOURCES/darling.tar.gz" 8 + fi 9 + tar --transform "s|^\./|darling/|" -cf "${CWD}/SOURCES/darling.tar.gz" -C "${CWD}/.." --exclude=.git --exclude SOURCES .