Yesterday I described the issue and options surrounding distributing libmtp as part of my node-mtp module. Basically, I don't need to distribute it on Linux as it's already available on most distro's, but it's not available by default on macOS without requiring the user to run brew install libmtp.
I think I have finally found a solution. Looking at the sodium-native post-install script I noticed that they're using the install_name_tool to tell the binaries where to look for their dynamically linked library. The full path is hard-coded into the binary, and you can view the shared libraries used using otool -L <filename>.
The easiest place to edit the linked library paths would be after the Node module is built, but before the prebuilds are generated, so I added the following to the before_deploy step in Travis:
if [ $TRAVIS_OS_NAME = osx ]; then
cp "$TRAVIS_BUILD_DIR/lib/libmtp.dylib" "$TRAVIS_BUILD_DIR/prebuilds/darwin-x64/";
install_name_tool -change "/usr/local/opt/libmtp/lib/libmtp.9.dylib" "@loader_path/libmtp.dylib" "$TRAVIS_BUILD_DIR/prebuilds/darwin-x64/node-napi.node";
otool -L "$TRAVIS_BUILD_DIR/prebuilds/darwin-x64/node-napi.node";
fi
So, if we're building on macOS, we copy the shared library libmtp.dylib into the prebuilds folder and then change the shared library path in our node-napi.node[1] module to point to that file. I also run otool just so that we can check that the path was changed correctly.
our module that is generated by prebuildify --napi ↩︎
Since libmtp is licensed under the LGPL, I'm trying to figure out how I should go about linking and distributing the library with my code without causing any problems. My code is licensed under BSD-2-Clause, and I'd like to keep it that way.
If I understand correctly, as long as I dynamically link to the libmtp library, I'm not creating a derivative work and I can include a copy of the library binaries. Now, do I need to compile my own versions of the libmtp binaries, or can I just copy over the ones installed by Homebrew?
It seems like an important part of LGPL is that people should be able to use a different version of the library with my app. On Linux, libmtp comes preinstalled on most distro's, so I don't mind just linking against that. Unfortunately, on macOS you need to install it first with brew install libmtp. I can't expect end-users to do this, so need to find a way to distribute the library with the app, in such a way that it can be replaced with a different version.
Compared to the previous times we moved house, getting the internet working at the new house was relatively frictionless. What annoyed me the most is that they sign you up to a completely new 18-month contract at higher prices, or you have to pay exit fees in the hundreds of pounds. So they basically have you between a rock and a hard place.
One issue that I have is that our new house, built more than a century ago, has stone walls. WiFi does not penetrate very well through stone walls. The two copper wires that are used to provide our “superfast fibre” internet terminate on the ground floor, while my home office is on the first floor. I'm lucky if I get 10Mbps in my office, while I'm paying for 76Mbps.
My first step was to swap out the ISP-provided router for a proper ASUS DSL router (with three massive antennas on top), but while it now provides better WiFi to the upper floors, it's still pretty slow in my office. After switching to the ASUS router I had to spend 40 minutes on the phone with the ISP to get everything working again, but that's a whole other story.
The next step is to get a WiFi extender, and if that fails I'll maybe get another ASUS router to try out their new AiMesh technology. I want to try powerline networking plugs, but given the age of the house I doubt that the electrical wiring will be up for it.
I managed to drill my first hole into our stone wall today. Our previous house had drywall everywhere, which was a nightmare. I had so many different types of screws and wall fixings for drywall and none of them could hold a decent amount of weight. Today I just drilled a hole, put in a wall plug and attached the wardrobe to the wall with a safety strap. Yesterday I mentioned that you have to pay to get rid of plasterboard here, so not having to deal with it at the new house is great.
There is still a lot of unpacking left to do, but I feel like we are making some headway, and at least I have a home office to work from again. Oh, I'm also happy to report that it's a lot easier to put IKEA furniture together than what it is to take it apart.
This afternoon we handed back the keys to our old rented house. We spent most of the day there cleaning and taking things to the tip. By the end of the day the house looked as good as new. Now we get to do the whole cleaning thing again at the new house, but then also unpack all the boxes that are standing around. Man, moving house is a lot of work!
I had an interesting experience at the tip today when I tried to drop off some pieces of plasterboard that was still in our garage. You're not allowed to place plasterboard in the rubble skip, and have to go to the baling plant next door to drop it off. The baling plant is where all the municipal garbage trucks go, as well as commercial waste.
When I drove into the baling plant, I had to park on a weigh bridge, so that they can measure the difference in weight when you leave to determine how much to charge you. You also get issued with a hard hat and hi-viz vest that you have to wear on site. It felt so over the top for the two pieces of plasterboard I had to drop off, but hey, what can you do?
We're finally all in at the new house! There is still a bit of cleaning left to do at the old house before we return the keys tomorrow. After a lot of self-imposed manual labour we have moved everything ourselves, going back and forth with a rented Volkswagen Transporter van.
I'm just so so glad that everything went well and that there were no big problems during the move. Now the unpacking, cleaning and getting settled starts. Here's to our new home, cheers!
I know, we're already in August and I'm only now getting to listing my favourite music and bands of the first half of 2018. So be it. For whatever reason, this has been my favourite track of 2018 so far:
The song itself is from 2009, but I only discovered this year. I'm not sure if Set Your Goals is still making music, as their last album is from 2011, but this is such a fun song!
The album I've been listening to the most in 2018 so far is South African punk rock band Fokofpolisiekar's 2017 album Selfmedikasie :
I was surprised to discover that Blink-182 released a deluxe edition of their 2016 album California in May 2017 with ten new songs:
If you know me, you'll know that Blink-182 is my all-time favourite band. So to randomly discover ten new songs was pretty sweet.
I really like a good steak. To be honest, I probably eat a lot more meat than necessary, in terms of required nutrients. Given the massive environmental impact of meat production, I thought I'd give some vegetarian and vegan recipes a try and see if I can eat less meat.
I recently came across a vegan mac & cheese recipe. I find the cheese substitute, deactivated yeast, very intriguing. Is it possible that it could even remotely taste cheesy? Well, I managed to get hold off deactivated yeast at a health shop today, and I'm going to give it a try and report back here.
I love coffee. As a graduate student working on my PhD thesis I remember coming across a quote that went something like this:
A programmer is a tool for converting coffee into code
At the time I very much felt like a tool for converting coffee into academic papers. We always had a thermos filled with coffee in our PhD office, and whoever emptied it would immediately make a fresh pot. To this day I still very much enjoy filter coffee, but have accumulated some other methods for making coffee too.
My introduction to the Aeropress was this video:
While I don't think that the coffee it makes is worthy of the term espresso, it does make a decent, very drinkable coffee with very little fuss. It does make quite a strong coffee, so I usually won't have more than one of these per day. Throughout the rest of the day, if I'm making coffee just for myself, I'll make a moka pot.
I've used my moka pot so many times that I had to have the rubber seal replaced. I first ordered the wrong size off eBay. I then resold the three seals separately on eBay, even making a very tiny profit. After replacing it with the right size seal, it's as good as new.
If I'm making coffee for more than one person, it doesn't get really any better than just using our regular old filter coffee machine. Why change something that works?