DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 4th October 2021
nihil nihil is offline
Port Guard
 
Join Date: Oct 2021
Posts: 27
Question sxiv image viewer

I've installed it from a port tree, but the problem with it is that
I can't change the source code, thus I won't be able to have my keybindings.

Compiling it from source results in missing libraries:
Code:
./sxiv.h:27:10: fatal error: 'Imlib2.h' file not found
#include <Imlib2.h>
         ^~~~~~~~~~
Even if I change all the includes to absolute paths:
Code:
/usr/local/include/Imlib2.h:28:10: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>
         ^~~~~~~~~~~~
I remember messing up my first install following compile errors and changing all the includes
I have a silly idea of changing the fetch url of the source code in sxiv port, but I have no idea how to.

Maybe I'm not seeing what's wrong here at all, help me out guys.
Reply With Quote
  #2   (View Single Post)  
Old 4th October 2021
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

The ports tree provides all of the infrastructure needed to build an installable package, with all required dependencies. If you leave the ports tree and work from an "upstream" project's source code directly, then you must recreate that infrastructure manually.

If I wanted to customize a port's source code for my own purposes, I would integrate those patches into the port, under the port tree's "mystuff" branch. Generally, the process would be something like:
  1. $ cd /usr/ports
  2. $ mkdir -p mystuff/graphics/sxiv
  3. $ cp -R graphics/sxiv mystuff/graphics/sxiv
  4. $ cd mystuff/graphics/sxiv
  5. I would edit the Makefile and add a REVISION that clearly identifies this as a customized port.
  6. $ make patch
  7. $ cd /usr/ports/pobj/sxiv*/sxiv*
  8. For each file I plan to edit: # cp name.of.file{,.orig}
  9. Edit each file with # vi name.of.file
  10. $ cd /usr/ports/mystuff/graphics/sxiv
  11. $ make update-patches
  12. $ make install or $ make update
The Porter's Handbook (a component of the FAQ) will give you more detailed guidance on using the ports tree, as will the ports(7) and bsd.port.mk(5) man pages.
Reply With Quote
  #3   (View Single Post)  
Old 4th October 2021
nihil nihil is offline
Port Guard
 
Join Date: Oct 2021
Posts: 27
Default

Tell me if I'm wrong

cd /usr/ports/graphics/sxiv
make patch
mkdir -p /usr/ports/pobj/sxiv
cd /usr/ports/pobj/sxiv
cp ~/fileiwanttoedit $(pwd)/
vi fileiwanttoedit
cd /usr/ports/graphics/sxiv
make update-patches
make install

Is that it?
Reply With Quote
  #4   (View Single Post)  
Old 5th October 2021
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

No. The top level source directory is $WRKBUILD, which at the moment is /usr/ports/pobj/sxiv-26/sxiv-26. Patches are created as unified diff(1)s against .orig files. So spend time with the Porter's Handbook and the bsd.port.mk(5) man page instead of guessing your way to a solution.


Edited to add: I'm sorry, but you did ask me to tell you if you were wrong, and there's a whole lot of wrong in your process as currently written. Some additional errors: not using the mystuff branch and not adding or updating the Makefile's $REVISION variable. One could cause data loss when the ports tree is revised, the other would cause package signature errors that could lead to library or other dependency mismatch problems, or replacement of your custom application with the standard package from a Project mirror.

Last edited by jggimi; 5th October 2021 at 03:19 AM.
Reply With Quote
  #5   (View Single Post)  
Old 5th October 2021
nihil nihil is offline
Port Guard
 
Join Date: Oct 2021
Posts: 27
Default

Alright, it seems that I'm expecting instant results and looking for a short solution, but then why did I install OpenBSD in the first place. Thank you for your feedback, you undoubtedly have the competence, so, I'll do as you said.
Reply With Quote
  #6   (View Single Post)  
Old 5th October 2021
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

For instant results, you could follow the process I outlined in my first reply.
Reply With Quote
  #7   (View Single Post)  
Old 5th October 2021
ibara ibara is offline
OpenBSD language porter
 
Join Date: Jan 2014
Posts: 783
Default

The port also tells you what libraries you need installed:
Code:
LIB_DEPENDS =   devel/libinotify \
                graphics/imlib2 \
                graphics/libexif
Provided they are installed, you should be able to download a tarball of sxiv and build it out-of-the-box and out of the ports tree with this command:
Code:
$ CFLAGS="-O2 -I/usr/X11R6/include -I/usr/X11R6/include/freetype2 -I/usr/local/include -I/usr/local/include/inotify" LDFLAGS="-L/usr/X11R6/lib -L/usr/local/lib -L/usr/local/lib/inotify -linotify -Wl,-rpath /usr/local/lib/inotify" make
Then you can edit source code to your heart's content without needing to worry about how ports does things.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PDF editor / viewer PapaParrot OpenBSD Packages and Ports 5 26th October 2017 01:16 AM
xkcd-viewer being stubborn both on -current and stable daemonfowl OpenBSD Packages and Ports 7 19th July 2013 03:23 AM
recommendations on a picture viewer divadgnol67 OpenBSD General 11 3rd April 2011 09:52 PM
Help installing Hippo viewer... bforest FreeBSD Ports and Packages 10 20th March 2010 02:17 PM
Image Titles JMJ_coder Feedback and Suggestions 4 1st July 2008 05:40 AM


All times are GMT. The time now is 05:21 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick