How to build pygkt 2.18 - pygtk

The gtk version of my linux PC is 2.18.
But I can't find corresponding pytgtk from http://ftp.gnome.org/pub/GNOME/sources/pygtk/

The GTK library is one thing, the PyGTK interface to that library is another thing.
The GTK lib is living http://www.gtk.org/download/index.php and it's usually just enough to compile it in a folder like ./usr/GTK and add that folder to your path.
The PyGTK lives in http://www.gtk.org/download/index.php but I prefer to install it from synaptic : sudo apt-get install python-gtk2
There is no need to have the pyGTK of the same version number as the GTK.

Related

How to use software built from source and installed with brew in the same project?

I am trying to get my head around package managers. I recently installed llvm in macOS using
brew install llvm
I installed python3.8 using pyenv and CMake latest release from https://cmake.org/download/. Brew displayed this message after the installation:
==> Dependencies
Build: cmake ✘, python#3.8 ✘
Required: libffi ✔
I have 2 questions:
Should I be concerned that I did not install CMake nor python3.8 using brew? I would like to know before replacing my previous CMake and python3.8 installations with those offered by brew.
Is there a way to use pakages/software installed with brew and without it in the same project and not make everything a mess? If there is, how can I learn to do it?
I am a physics major so my knowledge in these topics is not as good as I would like to.
Thanks for the help!

How do I install libudev with cmake

I have a binary (c++) and I want to link against the libudev library. But I want my cmake file verified if the udev library it's installed. If not, download the package and install it. But the only away to install udev library (I think) it's by using sudo apt-get install libudev-dev package or something like that.
My question is: is possible, using a cmake file, download the libudev-dev package ?

How to provide standard library sources for IntelliJ IDEA's Rust project?

I am using Mac for development. I installed Rust 1.13.0 using brew install rust and the Rust plugin 0.1.0.1385 for IntelliJ IDEA. I created my first test project with cargo and while opening it with IDEA I got the message
No standard library sources found, some code insight will not work
I haven't found any sources installed, nor the Rust sources package in Homebrew.
How do I provide sources for the project and what are the practical implication if I ignore this step?
As commented, the supported approach is to use rustup:
Navigate to https://rustup.rs/ and follow the installation instructions for your platform.
Add the rust-src component by running: rustup component add rust-src
Create a new Rust project in IntelliJ and choose your existing Rust project source. If the folder already contains previous IntelliJ project files, you may have to delete those first before it will let you proceed.
IntelliJ-Rust should automatically configure the standard library sources to point to the sources downloaded by rustup.
As a reference, since the question title is broad, for Fedora 28 I had to:
dnf install cargo rust-src
sudo ln -s /usr/lib/rustlib/src /usr/lib/rustlib/x86_64-unknown-linux-gnu/
then give /usr/lib/rustlib/x86_64-unknown-linux-gnu/src/rust/src as "Standard library"
Full setup:
Issue opened to simplify the process
When not using the rustup installer, one can install the source package and direct the rust plugin to use those:
(Tested with CLion 2020.2.1, rust-1.46.0-x86_64-pc-windows-gnu.msi, rustc-1.46.0-src.tar.gz. Offline Rust installers and source archive from there: https://forge.rust-lang.org/infra/other-installation-methods.html )
Although the preferred way of installing Rust is by using rustup, as pointed out by the other posts, it is not uncommon to use the packages that your distro makes available.
I use, for example, the packages provided by Gentoo and I share the same problem about the not prefilled field for standard libraries.
Nevertheless, you can easily find out where your standard libraries have been installed by typing the following find command:
find /usr/lib* -type d -name "rust" | grep src
or the following if you installed rust in your home
find -type d -name "rust" | grep src
The previous commands will help, unless, of course, in your distro there is a package for the binaries and one for the source and you only installed the binary one.
I know the question is for MacOS but this answer is shown up when searching for it on Linux. Below I will answer for Ubuntu.
The path is /usr/lib/rustlib/src/rust/src for Ubuntu 20.04
The way I did is:
Installed rustc from the repositories, which includes cargo
sudo apt install rustc
Then installed rust source package
sudo apt install rust-src
I used apt-file (can be installed with sudo apt install apt-file) to search for the install path of the sources
sudo apt-file update
apt-file list rust-src
This show the path as /usr/src/rustc-1.41.0/src .
But a ls -la in /usr/lib/rustlib/ will reveal symlinks and /usr/lib/rustlib/src/rust/src points to the previous found directory.
Using the symlink on IntelliJ will survive new rust versions.
For Fedora 32 install Rust using command:
dnf install cargo rust-src
and the path to standard libary source is:
/usr/lib/rustlib/src/rust
I used Ubuntu. I follow these steps:
sudo apt install rust-src
wait for the install, then
dpkg -L rust-src
copy the last line. For me it is the standard library path:
/usr/lib/rustlib/src/rust
For MacOS, you need to put /opt/homebrew/bin/.

yum install, select and link a specific version of a software

Suppose I want to install python2.7 with yum, and do
sudo yum install python27
This will install a python2.7 in the /usr/bin directory. However, the symbolic link /usr/bin/python still points to python2.6.
Is there a yum command that can manage this symbolic link rather than doing it manually? I know the port select in MacPorts does so, and am looking for a counterpart in yum. Thanks a lot!
Unless the distribution has been set up to handle this sort of thing (the way debian and some others are) you do not want to be changing the default value of something like /usr/bin/python because you will break anything the distribution packages which depends on the default python being the version of python in the default python package.
Things built against the python27 package almost certainly use /usr/bin/python2.7 when they need to run python scripts and/or on their shebang lines. Things packaged by the default system almost certainly just use /usr/bin/python assuming that is the default system python version.

OCaml Unbound Graphics Module

Running
open Graphics;;
in OCaml returns an error, saying it is an unbound module. Running it in terminal (ocaml) returns the same thing.
Does this mean my Graphics Module was somehow not installed with the OCaml package? If so, how can I install the module?
On Fedora.
This error also appears often on Mac OS X. With Homebrew this module is disabled by default on installation, so brew install ocaml will not install the Graphics module, probably due to the XQuartz dependency.
If you run brew info ocaml, it will tell you that there's a flag, namely --with-x11, that will "Install with the Graphics module". So to install/reinstall ocaml you'll have to run:
brew install Caskroom/cask/xquartz
brew [re]install ocaml --with-x11
Finally remember to check that the instance of ocaml that is running is the one in /usr/local/Cellar/objective-caml/x.yy.z[_w]/bin, and if it isn't then prepend that url to your PATH environment variable. Also remember to restart your computer after the XQuartz installation.
Graphics module is not ready by default. You need to load it manually. In toplevel:
$ ocaml
OCaml version blahblah
# #load "graphics.cma";;
# open Graphics;;
or you can specify it at the command line:
$ ocaml graphics.cma
OCaml version blahblah
# open Graphics;;
I do not know about Fedora but if the above fails, graphics is not really installed in your environment.