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

net-p2p/ipfs-desktop-bin: new package, add 0.39.0 #251

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Dawn-Xu-helloworld
Copy link
Contributor

I'm newbie here, am I do something wrong?

@Dawn-Xu-helloworld
Copy link
Contributor Author

Hello? any maintainers here?

@stkw0
Copy link
Contributor

stkw0 commented Oct 24, 2024

In first place, please read the relevant links found in the README.
Secondly, this is a user maintained repository. We may or may not look at pull requests.

About the ebuild. Indent the ebuild to make it easier to read. Move pkg_* functions to the end of the ebuild. For icons, use doicon instead of doins

@Dawn-Xu-helloworld
Copy link
Contributor Author

In first place, please read the relevant links found in the README. Secondly, this is a user maintained repository. We may or may not look at pull requests.

About the ebuild. Indent the ebuild to make it easier to read. Move pkg_* functions to the end of the ebuild. For icons, use doicon instead of doins

OK, I'm new here, and I would fix it

@Dawn-Xu-helloworld
Copy link
Contributor Author

In first place, please read the relevant links found in the README. Secondly, this is a user maintained repository. We may or may not look at pull requests.

About the ebuild. Indent the ebuild to make it easier to read. Move pkg_* functions to the end of the ebuild. For icons, use doicon instead of doins

So I would commit this repo directly?

@Dawn-Xu-helloworld Dawn-Xu-helloworld force-pushed the ipfs-desktop branch 2 times, most recently from b756e95 to dd496c3 Compare October 25, 2024 01:47
@Dawn-Xu-helloworld
Copy link
Contributor Author

OK, I fix it

<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>[email protected]</email>
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use the email address you registered with bugs.gentoo.org.

https://wiki.gentoo.org/wiki/Project:GURU#The_regulations

  1. Users that list themselves as maintainers must use an e-mail address known to bugs.gentoo.org in metadata.xml and keep it up to date in case it changes.

Copy link
Contributor Author

@Dawn-Xu-helloworld Dawn-Xu-helloworld Oct 28, 2024

Choose a reason for hiding this comment

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

This is a alias name for my email registered in bugs.gentoo.org. But I won't leave my phone numbers on GitHub, I wold change my gentoo bugzilla's email.

Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately, Bugzilla wouldn't know whether it's an alias or not.

$ curl 'https://bugs.gentoo.org/rest/[email protected]'
{"code":51,"error":true,"message":"There is no user named '[email protected]'. Either you mis-typed the name or that user has not yet registered for a Gentoo's Bugzilla account.","documentation":"https://bugzilla.readthedocs.org/en/5.0/api/"}

Copy link
Contributor

Choose a reason for hiding this comment

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

Your new email is still not registered. Can you login to Bugzilla with your new email address?

$ curl 'https://bugs.gentoo.org/rest/[email protected]'
{"code":51,"message":"There is no user named '[email protected]'. Either you mis-typed the name or that user has not yet registered for a Gentoo's Bugzilla account.","error":true,"documentation":"https://bugzilla.readthedocs.org/en/5.0/api/"}

EAPI=8
inherit desktop xdg unpacker optfeature
DESCRIPTION="A desktop client for IPFS. The IPFS's Native Application"
HOMEPAGE="https://github.com/ipfs-shipyard/ipfs-desktop"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
HOMEPAGE="https://github.com/ipfs-shipyard/ipfs-desktop"
HOMEPAGE="https://github.com/ipfs/ipfs-desktop"

inherit desktop xdg unpacker optfeature
DESCRIPTION="A desktop client for IPFS. The IPFS's Native Application"
HOMEPAGE="https://github.com/ipfs-shipyard/ipfs-desktop"
SRC_URI="https://github.com/ipfs/ipfs-desktop/releases/download/v${PV}/ipfs-desktop-${PV}-linux-amd64.deb"

This comment was marked as resolved.

app-crypt/libsecret
"
RDEPEND="${DEPEND}"
S="${WORKDIR}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
S="${WORKDIR}"

S should be defined right after SRC_URI.

pkg_postinst(){
xdg_pkg_postinst
optfeature "cli interface" net-p2p/kubo
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
}
}

S="${WORKDIR}"

src_prepare(){
default
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
default
default

Comment on lines 14 to 44
DEPEND="
x11-libs/gtk+:3
x11-libs/libnotify
dev-libs/nss
x11-libs/libXScrnSaver
x11-libs/libXtst
x11-misc/xdg-utils
app-accessibility/at-spi2-core
sys-apps/util-linux
app-crypt/libsecret
"
Copy link
Contributor

Choose a reason for hiding this comment

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

Those are not build-time dependencies. You only need them as RDEPEND.
There are also many missing runtime dependencies. You can check the linked libraries using lddtree /opt/IPFS\ Desktop/ipfs-desktop.

dev-libs/expat
dev-libs/glib:2
dev-libs/nspr
media-libs/alsa-lib
media-libs/mesa
net-print/cups
sys-apps/dbus
x11-libs/cairo
x11-libs/gdk-pixbuf:2
x11-libs/libX11
x11-libs/libXcomposite
x11-libs/libXdamage
x11-libs/libXext
x11-libs/libXfixes
x11-libs/libXrandr
x11-libs/libdrm
x11-libs/libxcb:=
x11-libs/libxkbcommon
x11-libs/pango

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK got it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But I think the packages in list are commonly for desktop profile users..., =_=

insinto "/usr/share"
# doins -r "${S}/usr/share/icons"
local size
for size in 16 24 32 48 64 128 256 512; do
Copy link
Contributor

Choose a reason for hiding this comment

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

There's no 24x24 icons.

default
unpacker "${S}/usr/share/doc/ipfs-desktop/changelog.gz"
# to prevent ipfs-desktop install build-in ipfs exe into /usr/local/bin or ${HOME}/.local/bin
# sed -i "s/^binpaths=\(.*\)$/binpaths=\'\/usr\/bin\'/" "${S}/opt/IPFS Desktop/resources/app.asar.unpacked/node_modules/kubo/kubo/install.sh"
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this? Is there a reason to leave a comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's for experimental... I'm trying to make ipfs-desktop run with system-wide ipfs, not the bundled...But It doesn't work.

Copy link
Contributor

Choose a reason for hiding this comment

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

Which was the problem?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Which was the problem?

Seems the path was hard-coded into ipfs-desktop...

Copy link
Contributor

Choose a reason for hiding this comment

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

You need to remove resources/app.asar.unpacked/node_modules/kubo/kubo/ipfs and then adjust resources/app.asar.unpacked/node_modules/kubo/src/index.js to grab ipfs binary from PATH.

@vitaly-zdanevich
Copy link
Contributor

Wow, thanks for the package. What is your use case for IPFS?

@Dawn-Xu-helloworld
Copy link
Contributor Author

Wow, thanks for the package. What is your use case for IPFS?

Just for fun... and to download something

Comment on lines 14 to 15
DEPEND="
"
Copy link
Contributor

Choose a reason for hiding this comment

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

You can just remove DEPEND here.

x11-libs/libxkbcommon
x11-libs/pango
"

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
QA_PREBUILT="*"

I forgot to mention, but please add QA_PREBUILT since this is a binary ebuild. Otherwise, QA will notify you that it doesn't respect {C,LD}FLAGS.
https://devmanual.gentoo.org/eclass-reference/ebuild/index.html

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I forgot to mention, but please add QA_PREBUILT since this is a binary ebuild. Otherwise, QA will notify you that it doesn't respect {C,LD}FLAGS. https://devmanual.gentoo.org/eclass-reference/ebuild/index.html

Hello... I fix it on WebIDE... sorry

@Dawn-Xu-helloworld
Copy link
Contributor Author

Sorry, but I have to commit it on webIDE

@pastalian
Copy link
Contributor

I'm still waiting for you to sync Bugzilla with the email address. Also, could you squash the commits into one?

@stkw0
Copy link
Contributor

stkw0 commented Nov 10, 2024

And also unbundle the pre-built ipfs binary.

@stkw0
Copy link
Contributor

stkw0 commented Nov 11, 2024

This patch seems to work to unbundle the ipfs without having to touch the javascript code

--- a/net-p2p/ipfs-desktop-bin/ipfs-desktop-bin-0.39.0.ebuild
+++ b/net-p2p/ipfs-desktop-bin/ipfs-desktop-bin-0.39.0.ebuild
@@ -2,7 +2,9 @@
 # Distributed under the terms of the GNU General Public License v2

 EAPI=8
-inherit desktop xdg unpacker optfeature
+
+inherit desktop xdg unpacker optfeature wrapper
+
 DESCRIPTION="A desktop client for IPFS. The IPFS's Native Application"
 HOMEPAGE="https://github.com/ipfs/ipfs-desktop"
 SRC_URI="https://github.com/ipfs/ipfs-desktop/releases/download/v${PV}/ipfs-desktop-${PV}-linux-amd64.deb"
@@ -11,50 +13,55 @@ LICENSE="MIT"
 SLOT="0"
 KEYWORDS="~amd64"

-RDEPEND="x11-libs/gtk+:3
-x11-libs/libnotify
-dev-libs/nss
-x11-libs/libXScrnSaver
-x11-libs/libXtst
-x11-misc/xdg-utils
-app-accessibility/at-spi2-core
-sys-apps/util-linux
-app-crypt/libsecret
-dev-libs/expat
-dev-libs/glib:2
-dev-libs/nspr
-media-libs/alsa-lib
-media-libs/mesa
-net-print/cups
-sys-apps/dbus
-x11-libs/cairo
-x11-libs/gdk-pixbuf:2
-x11-libs/libX11
-x11-libs/libXcomposite
-x11-libs/libXdamage
-x11-libs/libXext
-x11-libs/libXfixes
-x11-libs/libXrandr
-x11-libs/libdrm
-x11-libs/libxcb
-x11-libs/libxkbcommon
-x11-libs/pango
+RDEPEND="
+	x11-libs/gtk+:3
+	dev-libs/nss
+	app-accessibility/at-spi2-core
+	sys-apps/util-linux
+	app-crypt/libsecret
+	dev-libs/expat
+	dev-libs/glib:2
+	dev-libs/nspr
+	media-libs/alsa-lib
+	media-libs/mesa
+	net-p2p/kubo
+	net-print/cups
+	sys-apps/dbus
+	x11-libs/cairo
+	x11-libs/gdk-pixbuf:2
+	x11-libs/libnotify
+	x11-libs/libX11
+	x11-libs/libXcomposite
+	x11-libs/libXdamage
+	x11-libs/libXext
+	x11-libs/libXfixes
+	x11-libs/libXrandr
+	x11-libs/libdrm
+	x11-libs/libxcb
+	x11-libs/libxkbcommon
+	x11-libs/libXScrnSaver
+	x11-libs/libXtst
+	x11-libs/pango
+	x11-misc/xdg-utils
 "

 QA_PREBUILT="*"
+
 src_prepare(){
 	default
 	unpacker "${S}/usr/share/doc/ipfs-desktop/changelog.gz"
 }
+
 src_install(){
+	rm -r "${S}/opt/IPFS Desktop/resources/app.asar.unpacked/node_modules/kubo/kubo" || die
+
 	# clean up build-in kubo
 	insinto "/opt"
 	doins -r "${S}/opt/IPFS Desktop"
-	dosym -r "/opt/IPFS Desktop/ipfs-desktop" "/usr/bin/ipfs-desktop"
+	make_wrapper ipfs-desktop "env KUBO_BINARY=$(which ipfs) /opt/IPFS\\ Desktop/ipfs-desktop"
 	domenu "${S}/usr/share/applications/ipfs-desktop.desktop"
 	dodoc "${S}/changelog"
 	insinto "/usr/share"
-	# doins -r "${S}/usr/share/icons"
 	local size
 	for size in 16 32 48 64 128 256 512; do
 		 doicon -s ${size} "${S}/usr/share/icons/hicolor/${size}x${size}/apps/ipfs-desktop.png"
@@ -62,13 +69,4 @@ src_install(){
 	fperms +x "/opt/IPFS Desktop/ipfs-desktop"
 	fperms +x "/opt/IPFS Desktop/chrome-sandbox"
 	fperms +x "/opt/IPFS Desktop/chrome_crashpad_handler"
-	fperms +x "/opt/IPFS Desktop/resources/app.asar.unpacked/node_modules/kubo/kubo/ipfs"
-}
-
-pkg_postinst(){
-	xdg_pkg_postinst
-	optfeature "cli interface" net-p2p/kubo
-}
-pkg_postrm(){
-	xdg_pkg_postrm
 }

@Dawn-Xu-helloworld
Copy link
Contributor Author

This patch seems to work to unbundle the ipfs without having to touch the javascript code

--- a/net-p2p/ipfs-desktop-bin/ipfs-desktop-bin-0.39.0.ebuild
+++ b/net-p2p/ipfs-desktop-bin/ipfs-desktop-bin-0.39.0.ebuild
@@ -2,7 +2,9 @@
 # Distributed under the terms of the GNU General Public License v2

 EAPI=8
-inherit desktop xdg unpacker optfeature
+
+inherit desktop xdg unpacker optfeature wrapper
+
 DESCRIPTION="A desktop client for IPFS. The IPFS's Native Application"
 HOMEPAGE="https://github.com/ipfs/ipfs-desktop"
 SRC_URI="https://github.com/ipfs/ipfs-desktop/releases/download/v${PV}/ipfs-desktop-${PV}-linux-amd64.deb"
@@ -11,50 +13,55 @@ LICENSE="MIT"
 SLOT="0"
 KEYWORDS="~amd64"

-RDEPEND="x11-libs/gtk+:3
-x11-libs/libnotify
-dev-libs/nss
-x11-libs/libXScrnSaver
-x11-libs/libXtst
-x11-misc/xdg-utils
-app-accessibility/at-spi2-core
-sys-apps/util-linux
-app-crypt/libsecret
-dev-libs/expat
-dev-libs/glib:2
-dev-libs/nspr
-media-libs/alsa-lib
-media-libs/mesa
-net-print/cups
-sys-apps/dbus
-x11-libs/cairo
-x11-libs/gdk-pixbuf:2
-x11-libs/libX11
-x11-libs/libXcomposite
-x11-libs/libXdamage
-x11-libs/libXext
-x11-libs/libXfixes
-x11-libs/libXrandr
-x11-libs/libdrm
-x11-libs/libxcb
-x11-libs/libxkbcommon
-x11-libs/pango
+RDEPEND="
+	x11-libs/gtk+:3
+	dev-libs/nss
+	app-accessibility/at-spi2-core
+	sys-apps/util-linux
+	app-crypt/libsecret
+	dev-libs/expat
+	dev-libs/glib:2
+	dev-libs/nspr
+	media-libs/alsa-lib
+	media-libs/mesa
+	net-p2p/kubo
+	net-print/cups
+	sys-apps/dbus
+	x11-libs/cairo
+	x11-libs/gdk-pixbuf:2
+	x11-libs/libnotify
+	x11-libs/libX11
+	x11-libs/libXcomposite
+	x11-libs/libXdamage
+	x11-libs/libXext
+	x11-libs/libXfixes
+	x11-libs/libXrandr
+	x11-libs/libdrm
+	x11-libs/libxcb
+	x11-libs/libxkbcommon
+	x11-libs/libXScrnSaver
+	x11-libs/libXtst
+	x11-libs/pango
+	x11-misc/xdg-utils
 "

 QA_PREBUILT="*"
+
 src_prepare(){
 	default
 	unpacker "${S}/usr/share/doc/ipfs-desktop/changelog.gz"
 }
+
 src_install(){
+	rm -r "${S}/opt/IPFS Desktop/resources/app.asar.unpacked/node_modules/kubo/kubo" || die
+
 	# clean up build-in kubo
 	insinto "/opt"
 	doins -r "${S}/opt/IPFS Desktop"
-	dosym -r "/opt/IPFS Desktop/ipfs-desktop" "/usr/bin/ipfs-desktop"
+	make_wrapper ipfs-desktop "env KUBO_BINARY=$(which ipfs) /opt/IPFS\\ Desktop/ipfs-desktop"
 	domenu "${S}/usr/share/applications/ipfs-desktop.desktop"
 	dodoc "${S}/changelog"
 	insinto "/usr/share"
-	# doins -r "${S}/usr/share/icons"
 	local size
 	for size in 16 32 48 64 128 256 512; do
 		 doicon -s ${size} "${S}/usr/share/icons/hicolor/${size}x${size}/apps/ipfs-desktop.png"
@@ -62,13 +69,4 @@ src_install(){
 	fperms +x "/opt/IPFS Desktop/ipfs-desktop"
 	fperms +x "/opt/IPFS Desktop/chrome-sandbox"
 	fperms +x "/opt/IPFS Desktop/chrome_crashpad_handler"
-	fperms +x "/opt/IPFS Desktop/resources/app.asar.unpacked/node_modules/kubo/kubo/ipfs"
-}
-
-pkg_postinst(){
-	xdg_pkg_postinst
-	optfeature "cli interface" net-p2p/kubo
-}
-pkg_postrm(){
-	xdg_pkg_postrm
 }

but the xdg_pkg_postinst&postrm is necessary

@Dawn-Xu-helloworld
Copy link
Contributor Author

I'm still waiting for you to sync Bugzilla with the email address. Also, could you squash the commits into one?

I changed my email address on bugzilla, should I re-post my application mail?

@stkw0
Copy link
Contributor

stkw0 commented Nov 11, 2024

but the xdg_pkg_postinst&postrm is necessary

It's called automatically if _postrm _postinst are not overwritten

@Dawn-Xu-helloworld
Copy link
Contributor Author

hmmm.... I would re-push and fix this to guru's dev branch on gitweb.gentoo.org, tomorrow

gentoo-bot pushed a commit that referenced this pull request Nov 11, 2024
I'm not sure what happened here, but whatever.

Context: #251 (comment)
Signed-off-by: Takuya Wakazono <[email protected]>
@stkw0
Copy link
Contributor

stkw0 commented Nov 14, 2024

I guess you can close this PR given it's already on the tree

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.

4 participants