Fix PKGBUILD + more dev commands

This commit is contained in:
PaulCombal 2019-11-15 23:36:19 +01:00
parent 7ff28cf5d8
commit 5ff546711e
4 changed files with 33 additions and 9 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
vgcore.*
/bin/SamRewritten
/bin/samrewritten
/glade/*.glade~

View File

@ -1,14 +1,19 @@
CXX=g++ -std=c++17 -g
CXX=g++ -std=c++17
RM=rm -f
RMDIR=rm -rf
HFILES:=$(shell find src/ -type f -iname *.h -print)
CXXFILES:=$(shell find src/ -type f -iname *.cpp -print)
CXXFLAGS=$(shell pkg-config --cflags --libs gtk+-3.0) -rdynamic -export-dynamic -pthread -Wall -lpthread -lgmodule-2.0 -lsteam_api -lcurl -lyajl -ldl
GTKFLAGS=$(shell pkg-config --cflags --libs gtk+-3.0)
CXXFLAGS=$(GTKFLAGS) -rdynamic -export-dynamic -pthread -Wall -lpthread -lgmodule-2.0 -lsteam_api -lcurl -lyajl -ldl
LDFLAGS=-L${CURDIR}/bin
OBJDIR=obj
OBJS=$(addprefix ${OBJDIR}/,$(subst .cpp,.o,${CXXFILES}))
all: CXXFLAGS += -O3
all: ${CURDIR}/bin/samrewritten
@echo -e "==== Use '\033[1mmake dev\033[0m' to keep debug symbols"
@echo -e "==== Use '\033[1mmake clean\033[0m' to remove object files"
@echo -e "==== Nothing left to do."
${CURDIR}/bin/samrewritten: $(OBJS)
${CXX} -o ${CURDIR}/bin/samrewritten $(OBJS) ${LDFLAGS} ${CXXFLAGS}
@ -17,5 +22,8 @@ ${OBJDIR}/%.o: %.cpp $(HFILES)
@mkdir -p $$(dirname $@)
$(CXX) -c -o $@ $< ${LDFLAGS} $(CXXFLAGS)
dev: CXXFLAGS += -g
dev: ${CURDIR}/bin/samrewritten
clean:
${RMDIR} ${OBJDIR}

12
bin/valgrind.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
SCRIPT_PATH=`dirname $(realpath $0)`
export LD_LIBRARY_PATH=${SCRIPT_PATH}
# Workaround waiting for a fix https://github.com/lloyd/yajl/issues/222
export LC_NUMERIC=en_US.UTF-8
cd ${SCRIPT_PATH}/..
rm -f /tmp/sam-massif.out
valgrind --tool=massif --massif-out-file=/tmp/sam-massif.out ${SCRIPT_PATH}/samrewritten $@
massif-visualizer /tmp/sam-massif.out

View File

@ -3,13 +3,16 @@
pkgname="samrewritten-git"
_pkgname="SamRewritten"
pkgver=r79.4905336
pkgver=r119.7ff28cf
pkgrel=1
pkgdesc="A Steam Achievement Manager For Linux."
arch=("any")
url="https://github.com/PaulCombal/SamRewritten"
license=("GPL3")
depends=("steam" "yajl" "gtk3" "glibc" "curl")
optdepends=("zenity: error messages with style"
"valgrind: for automated dev script"
"massif-visualizer: for automated dev script")
makedepends=("git" "make" "gcc>=9.0")
source=("git+https://github.com/PaulCombal/SamRewritten.git")
sha256sums=("SKIP")
@ -27,12 +30,12 @@ build() {
package() {
install -dm755 "${pkgdir}/usr/lib/"
# Only copy required files. (Except for Glade files, as more may be added in the future.)
cp -r --parents "${_pkgname}/{LICENSE,README.MD,bin/{launch.sh,libsteam_api.so,samrewritten},glade/*.glade,assets/icon_256.png}" "${pkgdir}/usr/lib/"
install -Dm644 "${_pkgname}/assets/icon_256.png" "${pkgdir}/usr/share/icons/hicolor/256x256/apps/samrewritten.png"
install -Dm644 "${_pkgname}/assets/icon_64.png" "${pkgdir}/usr/share/icons/hicolor/64x64/apps/samrewritten.png"
cp -r --parents ${_pkgname}/{LICENSE,README.MD,bin/{launch.sh,libsteam_api.so,samrewritten},glade/*.glade,assets/icon_256.png} ${pkgdir}/usr/lib/
install -Dm644 ${_pkgname}/assets/icon_256.png ${pkgdir}/usr/share/icons/hicolor/256x256/apps/samrewritten.png
install -Dm644 ${_pkgname}/assets/icon_64.png ${pkgdir}/usr/share/icons/hicolor/64x64/apps/samrewritten.png
# Executable
install -dm755 "${pkgdir}/usr/bin"
ln -s "/usr/lib/${_pkgname}/bin/launch.sh" "${pkgdir}/usr/bin/samrewritten"
install -dm755 ${pkgdir}/usr/bin
ln -s /usr/lib/${_pkgname}/bin/launch.sh ${pkgdir}/usr/bin/samrewritten
# Desktop Entry
install -Dm644 "${_pkgname}/package/samrewritten.desktop" "${pkgdir}/usr/share/applications/samrewritten.desktop"
install -Dm644 ${_pkgname}/package/samrewritten.desktop ${pkgdir}/usr/share/applications/samrewritten.desktop
}