Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generic linux package #9351

Merged
merged 2 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ endif

# releases do not contain tests and misc data
IS_RELEASE := $(if $(or $(EMULATE_READER),$(WIN32)),,1)
IS_RELEASE := $(if $(or $(IS_RELEASE),$(APPIMAGE),$(DEBIAN),$(MACOS)),1,)
IS_RELEASE := $(if $(or $(IS_RELEASE),$(APPIMAGE),$(LINUX),$(MACOS)),1,)

ifeq ($(ANDROID_ARCH), arm64)
ANDROID_ABI?=arm64-v8a
Expand All @@ -29,6 +29,17 @@ endif
ANDROID_VERSION?=$(shell git rev-list --count HEAD)
ANDROID_NAME?=$(VERSION)

LINUX_ARCH?=native
ifeq ($(LINUX_ARCH), native)
LINUX_ARCH_NAME:=$(shell uname -m)
else ifeq ($(LINUX_ARCH), arm64)
LINUX_ARCH_NAME:=aarch64
else ifeq ($(LINUX_ARCH), arm)
LINUX_ARCH_NAME:=armv7l
endif
LINUX_ARCH_NAME?=$(LINUX_ARCH)


MACHINE=$(TARGET_MACHINE)
ifdef KODEBUG
MACHINE:=$(MACHINE)-debug
Expand Down
2 changes: 1 addition & 1 deletion base
52 changes: 8 additions & 44 deletions kodev
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,7 @@ SUPPORTED_TARGETS="
pocketbook
ubuntu-touch
appimage
debian Debian package for current arch
debian-armel Debian package for generic armel devices
debian-armhf Debian package for generic armhf devices
debian-arm64 Debian package for generic 64 bits arm devices
linux
macos MacOS app bundle. You need a mac to build this package
emu (*default) If no TARGET is given, assume emulator
win32
Expand Down Expand Up @@ -268,20 +265,8 @@ ${SUPPORTED_TARGETS}"
make TARGET=appimage
assert_ret_zero $?
;;
debian)
make TARGET=debian
assert_ret_zero $?
;;
debian-armel)
make TARGET=debian-armel
assert_ret_zero $?
;;
debian-armhf)
make TARGET=debian-armhf
assert_ret_zero $?
;;
debian-arm64)
make TARGET=debian-arm64
linux)
make TARGET=linux
assert_ret_zero $?
;;
macos)
Expand Down Expand Up @@ -389,17 +374,8 @@ ${SUPPORTED_TARGETS}"
appimage)
make TARGET=appimage clean
;;
debian)
make TARGET=debian clean
;;
debian-armel)
make TARGET=debian-armel clean
;;
debian-armhf)
make TARGET=debian-armhf clean
;;
debian-arm64)
make TARGET=debian-arm64 clean
linux)
make TARGET=linux clean
;;
macos)
is_mac
Expand Down Expand Up @@ -540,21 +516,9 @@ ${SUPPORTED_RELEASE_TARGETS}"
kodev-build appimage
make TARGET=appimage update
;;
debian)
kodev-build debian
make TARGET=debian update
;;
debian-armel)
kodev-build debian-armel
make TARGET=debian-armel update
;;
debian-armhf)
kodev-build debian-armhf
make TARGET=debian-armhf update
;;
debian-arm64)
kodev-build debian-arm64
make TARGET=debian-arm64 update
linux)
kodev-build linux
make TARGET=linux update
;;
macos)
is_mac
Expand Down
25 changes: 0 additions & 25 deletions make/debian.mk

This file was deleted.

34 changes: 34 additions & 0 deletions make/linux.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
LINUX_DIR = $(PLATFORM_DIR)/linux
LINUX_PACKAGE:=koreader-linux-$(LINUX_ARCH_NAME)$(KODEDUG_SUFFIX)-$(VERSION).tar.xz

update: all
mkdir -pv \
$(INSTALL_DIR)/linux/bin \
$(INSTALL_DIR)/linux/lib \
$(INSTALL_DIR)/linux/share/pixmaps \
$(INSTALL_DIR)/linux/share/applications \
$(INSTALL_DIR)/linux/share/doc/koreader \
$(INSTALL_DIR)/linux/share/man/man1
cp -pv resources/koreader.png $(INSTALL_DIR)/linux/share/pixmaps
cp -pv $(LINUX_DIR)/koreader.desktop $(INSTALL_DIR)/linux/share/applications
cp -pv $(LINUX_DIR)/copyright COPYING $(INSTALL_DIR)/linux/share/doc/koreader
cp -pv $(LINUX_DIR)/koreader.sh $(INSTALL_DIR)/linux/bin/koreader
cp -Lr $(INSTALL_DIR)/koreader $(INSTALL_DIR)/linux/lib
gzip -cn9 $(LINUX_DIR)/koreader.1 > $(INSTALL_DIR)/linux/share/man/man1/koreader.1.gz
chmod 644 \
$(INSTALL_DIR)/linux/share/doc/koreader/copyright \
$(INSTALL_DIR)/linux/share/man/man1/koreader.1.gz
rm -rf \
$(INSTALL_DIR)/linux/lib/koreader/{ota,cache,clipboard,screenshots,spec,tools,resources/fonts,resources/icons/src}

# remove leftovers
find $(INSTALL_DIR)/linux -type f \( -name ".git" -o -name ".gitignore" -o -name "discovery2spore" -o -name "wadl2spore" -o -name "*.txt" -o -name "LICENSE*" -o -name "NOTICE" -o -name "README.md" \) -print0 | xargs -0 rm -rf
find $(INSTALL_DIR)/linux -type d \( -name "test" -o -name ".github" \) -print0 | xargs -0 rm -rf

# fix permissions
chmod -R u=rwX,og=rX $(INSTALL_DIR)/linux
XZ_OPT=9 tar -C $(INSTALL_DIR)/linux -cvJf $(LINUX_PACKAGE) .

rm -rf $(INSTALL_DIR)/linux

.PHONY: update
11 changes: 0 additions & 11 deletions platform/debian/changelog

This file was deleted.

119 changes: 0 additions & 119 deletions platform/debian/do_debian_package.sh

This file was deleted.

File renamed without changes.
Loading