~julienxx/castor

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3

[PATCH 1/4] Remove duplicate binary installation

Details
Message ID
<20200416172646.25478-1-fgaz@fgaz.me>
DKIM signature
pass
Download raw message
Patch: +0 -1
---
 Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Makefile b/Makefile
index ee18f09..20aa2dc 100644
--- a/Makefile
+++ b/Makefile
@@ -38,7 +38,6 @@ install : target/release/castor
	$(INSTALL_DATA) data/org.typed-hole.castor-128.png $(sharedir)/icons/hicolor/128x128/apps/org.typed-hole.castor.png
	# Force icon cache refresh
	touch $(sharedir)/icons/hicolor
	cp target/release/castor /usr/bin/castor
	# Install desktop file
	$(INSTALL_DATA) data/Castor.desktop $(sharedir)/applications/Castor.desktop
	update-desktop-database
-- 
2.25.1

[PATCH 2/4] Separate install-data and copy-data phases

Details
Message ID
<20200416172646.25478-2-fgaz@fgaz.me>
In-Reply-To
<20200416172646.25478-1-fgaz@fgaz.me> (view parent)
DKIM signature
pass
Download raw message
Patch: +11 -5
Some platforms may want to build and install the rust binary separately
(for example for reproducibility and isolation reasons). This gives them
a way to only install the data files (with or without cache updates).
---
This is the only patch that actually makes it easier for me to package
castor, apply the others at your discretion

 Makefile | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 20aa2dc..a408b35 100644
--- a/Makefile
+++ b/Makefile
@@ -13,17 +13,26 @@ bindir=$(DESTDIR)$(PREFIX)/bin
sharedir=$(DESTDIR)$(PREFIX)/share

# Just tell make that clean, install, and uninstall doesn't generate files
.PHONY: clean clean-all install uninstall
.PHONY: clean clean-all install install-data copy-data uninstall

# Build the application
target/release/castor : src
	cargo build --release

install : target/release/castor
install : target/release/castor install-data
	# Create the bindir, if need be
	mkdir -p $(bindir)
	# Install binary
	$(INSTALL_PROGRAM) target/release/castor $(bindir)/castor

# Install the data files and update the caches
install-data : copy-data
	# Force icon cache refresh
	touch $(sharedir)/icons/hicolor
	update-desktop-database

# Just copy the data files, without updating caches
copy-data :
	# Create icon folders if needed
	mkdir -p $(sharedir)/icons/hicolor/scalable/apps/
	mkdir -p $(sharedir)/icons/hicolor/16x16/apps/
@@ -36,11 +45,8 @@ install : target/release/castor
	$(INSTALL_DATA) data/org.typed-hole.castor-32.png $(sharedir)/icons/hicolor/32x32/apps/org.typed-hole.castor.png
	$(INSTALL_DATA) data/org.typed-hole.castor-64.png $(sharedir)/icons/hicolor/64x64/apps/org.typed-hole.castor.png
	$(INSTALL_DATA) data/org.typed-hole.castor-128.png $(sharedir)/icons/hicolor/128x128/apps/org.typed-hole.castor.png
	# Force icon cache refresh
	touch $(sharedir)/icons/hicolor
	# Install desktop file
	$(INSTALL_DATA) data/Castor.desktop $(sharedir)/applications/Castor.desktop
	update-desktop-database

uninstall :
	# Remove the .desktop
-- 
2.25.1

[PATCH 3/4] Also remove the png icons on uninstall

Details
Message ID
<20200416172646.25478-3-fgaz@fgaz.me>
In-Reply-To
<20200416172646.25478-1-fgaz@fgaz.me> (view parent)
DKIM signature
pass
Download raw message
Patch: +2 -1
---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index a408b35..62a825c 100644
--- a/Makefile
+++ b/Makefile
@@ -51,8 +51,9 @@ copy-data :
uninstall :
	# Remove the .desktop
	rm -f $(sharedir)/applications/Castor.desktop
	# Remove the icon
	# Remove the icons
	rm -f $(sharedir)/icons/hicolor/scalable/apps/org.typed-hole.castor.svg
	rm -f $(sharedir)/icons/hicolor/*x*/apps/org.typed-hole.castor.png
	# Remove the binary
	rm -f $(bindir)/bin/castor

-- 
2.25.1

[PATCH 4/4] Use install -D instead of mkdir

Details
Message ID
<20200416172646.25478-4-fgaz@fgaz.me>
In-Reply-To
<20200416172646.25478-1-fgaz@fgaz.me> (view parent)
DKIM signature
pass
Download raw message
Patch: +1 -9
---
 Makefile | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index 62a825c..1b39fa8 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@
PREFIX=/usr

# What to run to install various files
INSTALL=install
INSTALL=install -D
# Run to install the actual binary
INSTALL_PROGRAM=$(INSTALL)
# Run to install application data, with differing permissions
@@ -20,8 +20,6 @@ target/release/castor : src
	cargo build --release

install : target/release/castor install-data
	# Create the bindir, if need be
	mkdir -p $(bindir)
	# Install binary
	$(INSTALL_PROGRAM) target/release/castor $(bindir)/castor

@@ -33,12 +31,6 @@ install-data : copy-data

# Just copy the data files, without updating caches
copy-data :
	# Create icon folders if needed
	mkdir -p $(sharedir)/icons/hicolor/scalable/apps/
	mkdir -p $(sharedir)/icons/hicolor/16x16/apps/
	mkdir -p $(sharedir)/icons/hicolor/32x32/apps/
	mkdir -p $(sharedir)/icons/hicolor/64x64/apps/
	mkdir -p $(sharedir)/icons/hicolor/128x128/apps/
	# Install icons
	$(INSTALL_DATA) data/org.typed-hole.castor.svg $(sharedir)/icons/hicolor/scalable/apps/org.typed-hole.castor.svg
	$(INSTALL_DATA) data/org.typed-hole.castor-16.png $(sharedir)/icons/hicolor/16x16/apps/org.typed-hole.castor.png
-- 
2.25.1
Review patch Export thread (mbox)