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 #1504

Merged
merged 2 commits into from
May 12, 2024
Merged

generic linux package #1504

merged 2 commits into from
May 12, 2024

Conversation

pazos
Copy link
Member

@pazos pazos commented Jul 19, 2022

  • remove soft-float arm32 variant

  • use LINUX_ARCH for cross compilation (supported are arm and arm64)

  • if LINUX_ARCH is not arm or arm64 we assume native compilation. It should work fine on all of the supported targets but only was tested against a 64 bit host.


This change is Reviewable

@Frenzie
Copy link
Member

Frenzie commented May 3, 2024

@pazos Was this ready to be merged? It looks sane enough to me.

Also pinging @benoit-pierre

Makefile.defs Outdated
Comment on lines 172 to 179
ifeq ($(LINUX_ARCH), arm)
CHOST?=arm-linux-gnueabihf
export LINUX_CROSS=1
else ifeq ($(LINUX_ARCH), arm64)
CHOST?=aarch64-linux-gnu
export LINUX_CROSS=1
else
export LINUX=1
export EMULATE_READER=1
endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DEBIAN_CROSS was never used anywhere, and neither is LINUX_CROSS, so I'd would get rid of it.

Additionally, I would not export LINUX.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it once was in koreader/koreader#9351? But it doesn't seem to be now in any case, so +1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 to remove the CROSS thingies.

The LINUX thingy is used in front to differenciate between "releases" and emulator builds.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but there's still no need to export to the environment for it to be available in the front Makefile (AFAIK the only user).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I didn't know. Based on that I guess we don't need to export MACOS either.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still need to set it, just not with the export keyword (which adds the variable to the environment):

	ifeq ($(LINUX_ARCH), arm)
		CHOST?=arm-linux-gnueabihf
	else ifeq ($(LINUX_ARCH), arm64)
		CHOST?=aarch64-linux-gnu
	else
		LINUX=1
		export EMULATE_READER=1
	endif

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And you're right, MACOS does not need to be exported either.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still need to set it, just not with the export keyword (which adds the variable to the environment):

	ifeq ($(LINUX_ARCH), arm)
		CHOST?=arm-linux-gnueabihf
	else ifeq ($(LINUX_ARCH), arm64)
		CHOST?=aarch64-linux-gnu
	else
		LINUX=1
		export EMULATE_READER=1
	endif

lol 😄

Now everything makes sense again :)

Makefile.defs Show resolved Hide resolved
Makefile.defs Show resolved Hide resolved
@benoit-pierre
Copy link
Contributor

Fix for turbo LUA files permissions:

 thirdparty/turbo/CMakeLists.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git i/thirdparty/turbo/CMakeLists.txt w/thirdparty/turbo/CMakeLists.txt
index c99f07d5..61e4f48d 100644
--- i/thirdparty/turbo/CMakeLists.txt
+++ w/thirdparty/turbo/CMakeLists.txt
@@ -10,6 +10,9 @@ assert_var_defined(LDFLAGS)
 
 ep_get_source_dir(SOURCE_DIR)
 
+# Some of the LUA files are executables for no good reason.
+list(APPEND PATCH_CMD COMMAND chmod a-x turbo/platform.lua turbo/socket_ffi.lua turbo/syscall.lua)
+
 set(BUILD_CMD ${KO_MAKE_RECURSIVE} "CC=${CC}" "CFLAGS=${CFLAGS}" "LDFLAGS=${LDFLAGS}" all)
 
 # Drop duplicate cdefs, make sure turbo find its libtffi_wrap library, and pull in upstream fixes

Copy link
Member

@Frenzie Frenzie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, any remaining comments @benoit-pierre ?

@benoit-pierre
Copy link
Contributor

LGTM.

@Frenzie Frenzie merged commit e138fe2 into koreader:master May 12, 2024
2 checks passed
Frenzie pushed a commit to koreader/koreader that referenced this pull request May 13, 2024
Relates to #9268
Requires koreader/koreader-base#1504

Usage: 
- `kodev release linux` for native package (same arch as host)
- `LINUX_ARCH=arm release linux` for armhf on a x86_64 host.
- `LINUX_ARCH=arm64 release linux` for arm64 on a x86_64 host.

It produces a `koreader-linux-$ARCH-$VERSION.tar.xz` archive, where $ARCH follows `uname -m` convention {x86_64, armv7l, aarch64}

To generate the debian package from the generic archive the following command is required

`./platform/linux/do_debian_package.sh path_to.tar.xz`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants