Skip to content

Instantly share code, notes, and snippets.

@wosc
Created December 18, 2018 19:52
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wosc/aac1b4f5f9cdb8ed84c1f8d9ec6ceebe to your computer and use it in GitHub Desktop.
Save wosc/aac1b4f5f9cdb8ed84c1f8d9ec6ceebe to your computer and use it in GitHub Desktop.
Build unison-2.51.2 deb, compatible with the MacOS binary release
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get -y install build-essential devscripts equivs git-buildpackage
cd /vagrant # if using Vagrant (which you should ;)
wget https://github.com/bcpierce00/unison/archive/v2.51.2.tar.gz
git clone https://salsa.debian.org/ocaml-team/unison src
git config user.name "YOUR NAME"
git config user.email "you@example.com"
cd src
mk-build-deps -i debian/control -t 'apt-get --no-install-recommends -y'
git checkout upstream
git checkout master
# https://honk.sigxcpu.org/projects/git-buildpackage/manual-html/index.html
gbp import-orig ../v2.51.2.tar.gz
gbp dch --git-author --new-version=2.51.2-1 --release --auto --commit
patch -p1 < ../srcdir.diff
git commit -a -m 'Upstream introduced a src/ directory'
gbp buildpackage
commit c1a1c51e7aa6d3ec3175d9198e0587c63f2b6367
Author: Wolfgang Schnerring <wosc@wosc.de>
Date: Tue Dec 18 18:23:11 2018 +0000
Upstream introduced a src/ directory
diff --git a/debian/rules b/debian/rules
index 7b76a24..c981da1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -80,9 +80,9 @@ endif
UISTYLE := $(shell dpkg --compare-versions 2.10 ge $(VERSION) && echo gtk || echo gtk2)
-DEB_INSTALL_DOCS_ALL := BUGS.txt TODO.txt unison-manual.txt -X unison.doc-base.in
+DEB_INSTALL_DOCS_ALL := src/BUGS.txt src/TODO.txt unison-manual.txt -X unison.doc-base.in
-DEB_INSTALL_CHANGELOGS_ALL := NEWS
+DEB_INSTALL_CHANGELOGS_ALL := src/NEWS
#
# Build unison
@@ -92,19 +92,19 @@ configure::
cp config/Makefile.unix config/Makefile
build/$(UNISON_PACKAGE)::
- $(MAKE) UISTYLE=text NATIVE=$(NATIVE) $(MY_MAKE_FLAGS) CFLAGS=
- mv '$(CURDIR)/unison' '$(CURDIR)/$(UNISON)'
+ $(MAKE) -C src UISTYLE=text NATIVE=$(NATIVE) $(MY_MAKE_FLAGS) CFLAGS=
+ mv '$(CURDIR)/src/unison' '$(CURDIR)/$(UNISON)'
build/$(UNISON_GTK_PACKAGE):: debian/$(UNISON_GTK_PACKAGE).xpm
- $(MAKE) UISTYLE=$(UISTYLE) NATIVE=$(NATIVE) $(MY_MAKE_FLAGS) CFLAGS=
- mv '$(CURDIR)/unison' '$(CURDIR)/$(UNISON_GTK)'
+ $(MAKE) -C src UISTYLE=$(UISTYLE) NATIVE=$(NATIVE) $(MY_MAKE_FLAGS) CFLAGS=
+ mv '$(CURDIR)/src/unison' '$(CURDIR)/$(UNISON_GTK)'
if test 'x$(OCAML_HAVE_OCAMLOPT)' = 'xyes'; then /usr/bin/chrpath -d '$(CURDIR)/$(UNISON_GTK)'; fi
clean::
-$(RM) '$(CURDIR)/$(UNISON_GTK)'
-$(RM) '$(CURDIR)/$(UNISON)'
- $(MAKE) clean
- rm lwt/depend ubase/depend
+ $(MAKE) -C src clean
+ rm src/lwt/depend src/ubase/depend
debian/unison-manual.txt: build/$(UNISON_PACKAGE)
env HOME='$(CURDIR)' '$(CURDIR)/$(UNISON)' -doc all > '$(CURDIR)/unison-manual.txt'
Vagrant.configure("2") do |config|
config.vm.define "default" do |default|
default.vm.hostname = "unisonbuild"
default.vm.provider "lxc"
default.vm.box = "zeitonline/bionic64-lxc"
# default.vm.box = "bento/ubuntu-18.04"
end
end
@goetzc
Copy link

goetzc commented Jan 6, 2019

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment